Audacity  2.2.0
NumberFormatter Class Reference

#include <numformatter.h>

Public Types

enum  Style {
  Style_None = 0x00, Style_WithThousandsSep = 0x01, Style_NoTrailingZeroes = 0x02, Style_OneTrailingZero = 0x04,
  Style_TwoTrailingZeroes = 0x08, Style_ThreeTrailingZeroes = 0x10
}
 

Static Public Member Functions

static wxString ToString (long val, int style=Style_WithThousandsSep)
 
static wxString ToString (wxLongLong_t val, int style=Style_WithThousandsSep)
 
static wxString ToString (double val, int precision, int style=Style_WithThousandsSep)
 
static bool FromString (const wxString &s, long *val)
 
static bool FromString (const wxString &s, wxLongLong_t *val)
 
static bool FromString (const wxString &s, double *val)
 
static wxChar GetDecimalSeparator ()
 
static bool GetThousandsSeparatorIfUsed (wxChar *sep)
 

Static Protected Member Functions

static void RemoveTrailingZeroes (wxString &s, size_t retain=0)
 

Static Private Member Functions

static wxString PostProcessIntString (const wxString &s, int style)
 
static void AddThousandsSeparators (wxString &s)
 
static void RemoveThousandsSeparators (wxString &s)
 

Friends

class FloatingPointValidatorBase
 

Member Enumeration Documentation

Enumerator
Style_None 
Style_WithThousandsSep 
Style_NoTrailingZeroes 
Style_OneTrailingZero 
Style_TwoTrailingZeroes 
Style_ThreeTrailingZeroes 

Member Function Documentation

void NumberFormatter::AddThousandsSeparators ( wxString &  s)
staticprivate
bool NumberFormatter::FromString ( const wxString &  s,
long *  val 
)
static
bool NumberFormatter::FromString ( const wxString &  s,
wxLongLong_t *  val 
)
static
bool NumberFormatter::FromString ( const wxString &  s,
double *  val 
)
static
wxChar NumberFormatter::GetDecimalSeparator ( )
static
bool NumberFormatter::GetThousandsSeparatorIfUsed ( wxChar *  sep)
static
wxString NumberFormatter::PostProcessIntString ( const wxString &  s,
int  style 
)
staticprivate
void NumberFormatter::RemoveThousandsSeparators ( wxString &  s)
staticprivate

References GetThousandsSeparatorIfUsed().

Referenced by FromString().

void NumberFormatter::RemoveTrailingZeroes ( wxString &  s,
size_t  retain = 0 
)
staticprotected

References GetDecimalSeparator().

Referenced by ToString().

wxString NumberFormatter::ToString ( long  val,
int  style = Style_WithThousandsSep 
)
static
wxString NumberFormatter::ToString ( wxLongLong_t  val,
int  style = Style_WithThousandsSep 
)
static
wxString NumberFormatter::ToString ( double  val,
int  precision,
int  style = Style_WithThousandsSep 
)
static

Friends And Related Function Documentation

friend class FloatingPointValidatorBase
friend

The documentation for this class was generated from the following files: