Rise
The Vieneo Province
Loading...
Searching...
No Matches
StringUtilities.h
Go to the documentation of this file.
1#pragma once
2
3inline void Format4Sig(wchar_t* res, const float num)
4{
5 if (num < 10.0f)
6 swprintf_s(res, 16, L"%4.3f", num);
7 else if (num < 100.0f)
8 swprintf_s(res, 16, L"%4.2f", num);
9 else if (num < 1000.0f)
10 swprintf_s(res, 16, L"%4.1f", num);
11 else
12 swprintf_s(res, 16, L"%4.0f", num);
13}
14
15inline bool IsNullOrWhitespace(const WCHAR* string)
16{
17 if (!string)
18 return true;
19
20 for (const WCHAR* p = string; *p; ++p)
21 {
22 if (!iswspace(*p))
23 return false;
24 }
25 return true;
26}
void Format4Sig(wchar_t *res, const float num)
bool IsNullOrWhitespace(const WCHAR *string)