Skip to main content

Function: cleanLogTick()

cleanLogTick(price, precisionOrType): number

Clean logarithmic tick for a price, rounded to a "nice" 1/2/5×10^k value.

Use this for UI steppers and for snapping: it fixes the raw sub-1 ticks (initPriceDecimals gives 0.09 at price 0.9) to clean values (0.1), and is correct at any magnitude (10000 at normal/precision 2 → 100).

Parameters

price

number

The price to compute a tick for.

precisionOrType

A TickType or a raw numeric precision.

number | TickType

Returns

number