ezEngine  Release 25.03
ezArgHumanReadable Struct Reference

Formats a given number such that it will be in format [0, base){suffix} with suffix representing a power of base. Resulting numbers are output with a precision of 2 fractional digits and fractional digits are subject to rounding, so numbers at the upper boundary of [0, base) may be rounded up to the next power of base. More...

#include <FormatStringArgs.h>

Inheritance diagram for ezArgHumanReadable:

Public Member Functions

 ezArgHumanReadable (const double value, const ezUInt64 uiBase, const char *const *const pSuffixes, ezUInt32 uiSuffixCount)
 
 ezArgHumanReadable (const ezInt64 value, const ezUInt64 uiBase, const char *const *const pSuffixes, ezUInt32 uiSuffixCount)
 
 ezArgHumanReadable (const double value)
 
 ezArgHumanReadable (const ezInt64 value)
 

Public Attributes

const double m_Value
 
const ezUInt64 m_Base
 
const char *const *const m_Suffixes
 
const char *const m_DefaultSuffixes [6] = {"", "K", "M", "G", "T", "P"}
 
const ezUInt32 m_SuffixCount
 

Detailed Description

Formats a given number such that it will be in format [0, base){suffix} with suffix representing a power of base. Resulting numbers are output with a precision of 2 fractional digits and fractional digits are subject to rounding, so numbers at the upper boundary of [0, base) may be rounded up to the next power of base.

E.g.: For the default case base is 1000 and suffixes are the SI unit suffixes (i.e. K for kilo, M for mega etc.) Thus 0 remains 0, 1 remains 1, 1000 becomes 1.00K, and 2534000 becomes 2.53M. But 999.999 will end up being displayed as 1000.00K for base 1000 due to rounding.


The documentation for this struct was generated from the following file: