diff options
| author | aura <nw@moneybot.cc> | 2026-03-16 15:40:03 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-03-16 15:40:03 +0100 |
| commit | 991352b0d2767e6bd1a46f554db4ac9d208c13ad (patch) | |
| tree | ec89dcc1bf6e5ad21474ee91a8b9d0f8301c7f1c /src/util/string.h | |
| parent | e59a032fb9afac6496acf3fba51a2a329bd0f992 (diff) | |
finish prop rewrite
Diffstat (limited to 'src/util/string.h')
| -rw-r--r-- | src/util/string.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/string.h b/src/util/string.h index 7dfab69..672fb5d 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -274,3 +274,11 @@ struct __str : public LIST<CT> { using STR = __str<char>; using WSTR = __str<wchar_t>; + +inline STR to_str( F32 f ) { return STR( "%.02f", f ); } +inline STR to_str( F64 f ) { return STR( "%.02g", f ); } +inline STR to_str( I32 i ) { return STR( "%d", i ); } +inline STR to_str( I64 i ) { return STR( "%lld", i ); } +inline STR to_str( U32 u ) { return STR( "%u", u ); } +inline STR to_str( U64 u ) { return STR( "%llu", u ); } +inline STR to_str( void* p ) { return STR( "%llx", (U64)p ); } |
