Plasma Engine  2.0
Loading...
Searching...
No Matches
plArgHumanReadable 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 plArgHumanReadable:

Public Member Functions

 plArgHumanReadable (const double value, const plUInt64 uiBase, const char *const *const pSuffixes, plUInt32 uiSuffixCount)
 
 plArgHumanReadable (const plInt64 value, const plUInt64 uiBase, const char *const *const pSuffixes, plUInt32 uiSuffixCount)
 
 plArgHumanReadable (const double value)
 
 plArgHumanReadable (const plInt64 value)
 

Public Attributes

const double m_Value
 
const plUInt64 m_Base
 
const char *const *const m_Suffixes
 
const char *const m_DefaultSuffixes [6] = {"", "K", "M", "G", "T", "P"}
 
const plUInt32 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: