|
wxMaxima
|
Defines where a number gets its digit-group gaps, see DigitGrouping.h. More...
Functions | |
| int | wxm::DigitGroupGapWidth (double fontSize) |
| How wide a digit-group gap is, in pixels, for text of the given font size. | |
| int | wxm::LocaleDigitGroupSize () |
| How many digits a group has: what the C library's LC_NUMERIC locale says, if that is 3 or 4, otherwise 3. | |
| std::vector< size_t > | wxm::DigitGroupGaps (const wxString &number, size_t minDigits, size_t groupSize=3) |
| The indices into number before which a digit-group gap is drawn, ascending. | |
| std::vector< std::vector< size_t > > | wxm::DigitGroupGapsInTokens (const std::vector< std::pair< wxString, bool > > &tokens, size_t minDigits, size_t groupSize=3) |
| DigitGroupGaps() for code, where a number may span several tokens. | |
Defines where a number gets its digit-group gaps, see DigitGrouping.h.
| std::vector< size_t > wxm::DigitGroupGaps | ( | const wxString & | number, |
| size_t | minDigits, | ||
| size_t | groupSize = 3 |
||
| ) |
The indices into number before which a digit-group gap is drawn, ascending.
number is a number as Maxima prints it, optionally preceded by a sign (including the unicode minus sign MathParser turns "-" into): "12345", "−3.14159", "1.234567b10", "6.02214076e23".
| std::vector< std::vector< size_t > > wxm::DigitGroupGapsInTokens | ( | const std::vector< std::pair< wxString, bool > > & | tokens, |
| size_t | minDigits, | ||
| size_t | groupSize = 3 |
||
| ) |
DigitGroupGaps() for code, where a number may span several tokens.
MaximaTokenizer makes "3.14159" three tokens, "3", "." and "14159", and ".5" two. Grouped one token at a time, the digits after the point would be grouped from the right, like an integer's; this joins such tokens up into the number they form first.
tokens holds each token's text and whether it is a number token. The result has one entry per token: the gaps inside it, as indices into that token's own text. A gap never falls on a token boundary, so each gap belongs to exactly one token.
| int wxm::DigitGroupGapWidth | ( | double | fontSize | ) |
How wide a digit-group gap is, in pixels, for text of the given font size.
5/24 of an em: halfway between a typographic thin space (a sixth of an em, what the gap started out as, which made the groups a bit hard to tell apart) and a quarter of an em (what it was widened to next, which felt a little too wide). Output (TextCell) and code (EditorCell) both use this, so that a number looks the same in either. Never less than one pixel, so the gap doesn't vanish at tiny zoom levels.
| int wxm::LocaleDigitGroupSize | ( | ) |
How many digits a group has: what the C library's LC_NUMERIC locale says, if that is 3 or 4, otherwise 3.
Locales with irregular grouping (India's 12,34,56,789) get groups of their first size throughout, which is what LongNumberCell::BreakUp() has always done, too.