10#if !defined (HPP_ALIB_STRINGS_NUMBERFORMAT)
15#if defined( _WIN32 ) || defined(__APPLE__) || defined(__ANDROID_NDK__)
19namespace alib {
namespace strings {
27template<
typename TChar>
30 struct lconv * lc=localeconv();
32 DecimalPointChar=
static_cast<TChar
>( *(lc->decimal_point) );
33 ThousandsGroupChar=
static_cast<TChar
>( *(lc->thousands_sep) );
36template<
typename TChar>
39 if ( other ==
nullptr )
47 template<
typename TChar>
48 void setComputational( TNumberFormat<TChar>& nf )
50 nf.Flags = NumberFormatFlags::NONE;
51 nf.DecimalPointChar =
'.';
52 nf.Flags =
NumberFormatFlags( uint8_t(nf.Flags) | uint8_t(NumberFormatFlags::ForceDecimalPoint) );
53 nf.Whitespaces = TT_StringConstants<TChar>::DefaultWhitespaces();
57 nf.DecMinimumFieldWidth=
61 nf.IntegralPartMinimumWidth=
62 nf.FractionalPartWidth= -1;
65 nf.LeadingGroupCharReplacement=
' ';
67 nf.ThousandsGroupChar=
',';
69 nf.BinNibbleGroupChar=
71 nf.HexWord32GroupChar=
72 nf.OctGroupChar=
'\'';
74 nf.HexByteGroupChar=
'\0';
75 nf.BinByteGroupChar=
'-';
76 nf.BinWordGroupChar=
'=';
77 nf.BinWord32GroupChar=
'#';
85 setComputational( *
this );
87 ExponentSeparator =
"E" ;
90 BinLiteralPrefix =
"0b" ;
91 HexLiteralPrefix =
"0x" ;
92 OctLiteralPrefix =
"0o" ;
98 setComputational( *
this );
100 ExponentSeparator =
A_WCHAR(
"E" ) ;
101 INFLiteral =
A_WCHAR(
"INF" ) ;
102 NANLiteral =
A_WCHAR(
"NAN" ) ;
103 BinLiteralPrefix =
A_WCHAR(
"0b" ) ;
104 HexLiteralPrefix =
A_WCHAR(
"0x" ) ;
105 OctLiteralPrefix =
A_WCHAR(
"0o" ) ;
111 setComputational( *
this );
113 ExponentSeparator =
A_XCHAR(
"E" ) ;
114 INFLiteral =
A_XCHAR(
"INF" ) ;
115 NANLiteral =
A_XCHAR(
"NAN" ) ;
116 BinLiteralPrefix =
A_XCHAR(
"0b" ) ;
117 HexLiteralPrefix =
A_XCHAR(
"0x" ) ;
118 OctLiteralPrefix =
A_XCHAR(
"0o" ) ;