NumberFormatterComponent Class
Component that formats arithmetic values into a display string. More...
Declaration
Public Member Functions Index
| void | setFormat (std::string format) |
|
Sets the format string. More... | |
template <typename T> | |
| std::string | format (T value) const |
|
Formats the given arithmetic value into a display string. More... | |
Private Member Attributes Index
| std::string | format_ = "{:0.f}" |
|
The format string used by std::vformat. More... | |
Description
Component that formats arithmetic values into a display string.
Holds a std::vformat-compatible format string that accepts a single arithmetic argument. Used by binding systems to convert numeric game state (e.g. scores, health) into text for UiTextComponent.
- See Also
Score2UiTextUpdateSystem
- See Also
MaxScore2UiTextUpdateSystem
Definition at line 25 of file NumberFormatterComponent.ixx.
Public Member Functions
format()
| inline |
Formats the given arithmetic value into a display string.
- Template Parameters
-
T An arithmetic type (int, float, double, etc.).
- Parameters
-
value The value to format.
- Returns
The formatted string.
Definition at line 56 of file NumberFormatterComponent.ixx.
Referenced by setFormat.
setFormat()
| inline |
Private Member Attributes
format_
|
The format string used by std::vformat.
Definition at line 30 of file NumberFormatterComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.