#include "NamedGroupLabeler.h"
Generates "standard" American group labels for very large numbers.
- Note
- The term standard is used loosely - especially when moving beyond the "centillion" barrier. See https://en.wikipedia.org/wiki/Names_of_large_numbers See https://web.archive.org/web/20220811012924/https://faculty.kutztown.edu/schaeffe/Tutorials/General/LargeNumbers.html. See https://character.fandom.com/wiki/List_of_Illion_numbers The system used is based on that from Conway, Guy, and Wechsler described in [wikipedia], with updates based on new standard dictionary numbers adopted since that time.
Updates from Conway, Guy, and Wechsler:
- "Quinqua" shortened to "Quin" universally with the adoption of quindecillion as a standard dictionary number.
- "Noven" replaced universally with "Novem" with the adoption of novemdecillion as a standard dictionary number. (nx) rule groups now use "Novem" but still use "Septen".
- "Sedecillion" and other (6-10) grouping combinations like "Sedecicentillion" are replaced with "Sexdecillion" and "Sexdecicentillion" with the adoption of sexdecillion as a standard dictionary number. Deci now has as special rule group (n6) that behaves just like group (n) but adding this new special behavior for sexdecillion.
◆ UNamedGroupLabeler()
UNamedGroupLabeler::UNamedGroupLabeler |
( |
| ) |
|
|
Flavor:Constructor |
◆ AppendNamedGroupLabel()
DBN_FORCEINLINE int UNamedGroupLabeler::AppendNamedGroupLabel |
( |
int32 |
powerOfTen, |
|
|
FString & |
string |
|
) |
| |
|
staticFlavor:Static |
Provides implementation for appending the group label for the specified powerOfTen into string, and returning any remaining power of ten.
- Parameters
-
powerOfTen | The power of ten for which to get the label |
string | The string to append the group label to |
- Returns
- Any remaining power of ten beyond the closest label (see below)
- Note
- Remainder is any remaining power of ten beyond the closest label. For example, if you pass in 4 to the SI Unit Names labeler, you will get back "kilo", plus a remainder of one, representing that this is tens of kilos.
-
Override this function to create your own custom Group Labeler that can be plugged into a Scaling Formatter.
- Implements Opcode:
- Flavor:Instance
I4 ← lbl BG I4 S&
- Implements Opcode:
- Flavor:Static
I4 ← lbln I4 S&
◆ GetDefault()
Gets the default instance of this type of group labeler
- Returns
- the default instance of this type of group labeler
- Implements Opcode:
- Flavor:Static
NG ← glbln 0
◆ GetNamedGroupLabel()
DBN_FORCEINLINE FString UNamedGroupLabeler::GetNamedGroupLabel |
( |
int32 |
powerOfTen | ) |
|
|
staticFlavor:Static |
Gets the group label for the specified powerOfTen
- Parameters
-
powerOfTen | The power of ten for which to get the label |
- Returns
- The group label for the specified power of ten
- Note
- Any remainder in the powerOfTen is lost. For example, if you pass in 4 to the SI Unit Names labeler, you will get back "kilo", but will lose the information that this actually represented tens of kilos instead of ones of kilos. To keep this information, use AppendGroupLabel.
- Implements Opcode:
- Flavor:Instance
S ← lbl BG I4
- Implements Opcode:
- Flavor:Static
S ← lbln I4
◆ OnAppendGroupLabel()
int UNamedGroupLabeler::OnAppendGroupLabel |
( |
int32 |
powerOfTen, |
|
|
FString & |
string |
|
) |
| const |
|
overridevirtualFlavor:Instance |
Appends the label for the given standard grouping of digits to the given string. i.e. passing 1 returns "thousand", passing 2 returns "million", passing 3 returns "billion"... Returns valid names up a powerOfTen range from -30005 to 30005), after which it returns a scientific notation exponent (i.e. "e50000"). If zero is passed for grouping, no label will be appended. Negative powerOfTen values will append "th" to the result.
- Parameters
-
powerOfTen | the index of the grouping to get the label for |
string | the string to append the label to |
- Returns
- Any remaining power of 10 beyond the group name, signifying order-of-magnitude gaps between group names. For instance, If the NamedGroupLabeler is passed a powerOfTen of 7, "million" would be appended to the string, and 1 would be returned, since 10^7 is ten million.
- Note
- If zero is passed for grouping, no label will be appended.
- Implements Opcode:
- Flavor:Instance
I4 ← lbl NG I4 S&
Reimplemented from UGroupLabeler.
The documentation for this class was generated from the following files: