feat: 完成....

This commit is contained in:
2026-01-07 23:22:15 +08:00
parent ad070b51f2
commit f01762dab2
45 changed files with 4501 additions and 26 deletions

View File

@@ -0,0 +1,15 @@
/**
* 从最小单位step中推导小数位数
*
* "1.00000000" -> 0
* "0.01000000" -> 2
* "0.00010000" -> 4
*/
export function getDecimalPlacesFromStep(step: string): number {
const [, decimal = ""] = step.split(".")
if (!decimal) return 0
const index = decimal.search(/[1-9]/)
return index === -1 ? 0 : index + 1
}