Skip to main content

Module formatting

Module formatting 

Source
Expand description

Numeric formatting shared by annotations and app panels.

Functionsยง

compact_decimal
Fixed precision without trailing fractional zeros. Preserves signed zero; callers that use the result as an identifier may choose to normalize it.
snap_drag_moved
One stored number after a drag: on the grid if the drag moved it, otherwise exactly what it was, so that dragging X leaves a typed Y of 1.23456 alone.
snap_drag_value
value on the 0.001 drag grid. Divides by the exact integer rather than multiplying by 0.001, which is not representable and would bring back the 12.300000000000001 the grid exists to remove. Never returns -0.