dragnumberformat
Lays out one DragNumber value on a fixed column grid.
| Group | libwidgets |
Detailed description
The functions here know no widget and no font. A DragNumber measures one column, gives each number a run of whole columns, and asks layout() for the text. Rows that share fractionColumns put their decimal points on one column (vector-drag-number §VND-5, §VND-9).
See also DragNumber.
Function documentation
layout
dragnumberformat::Cell dragnumberformat::layout(double value, int decimals, int fractionColumns, int columns)
Lays out value in exactly columns characters.
decimals is what the parameter shows. fractionColumns is the fraction width of the group, and is raised to decimals when it is smaller. The rules of vector-drag-number §VND-5 apply in order, and the first that fits wins: the point on the point column, then the most decimals that fit right aligned, then 'e' notation, then '#'. NaN and infinity are the words nan, inf and -inf, right aligned.
Returns the text, the column of its '.', and the rule that made it.