Rounds a price to the appropriate precision based on the tick size.
If tickSize is not a positive finite number
roundTicks(123.456789, 0.01) // returns "123.46"roundTicks("100.12345", 0.001) // returns "100.123"roundTicks(123.456789, 1) // returns "123"roundTicks(123.456789, 1e-9) // returns "123.456789000" Copy
roundTicks(123.456789, 0.01) // returns "123.46"roundTicks("100.12345", 0.001) // returns "100.123"roundTicks(123.456789, 1) // returns "123"roundTicks(123.456789, 1e-9) // returns "123.456789000"
The price to round, can be a string or number
The tick size that determines the precision (e.g., 0.01 for 2 decimal places)
The price rounded to the precision specified by the tick size
Rounds a price to the appropriate precision based on the tick size.
Throws
If tickSize is not a positive finite number
Example