summaryrefslogtreecommitdiff
path: root/src/util/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/string.h')
-rw-r--r--src/util/string.h8
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 ); }