Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1996, Microsoft Corporation.
  4. //
  5. // File: xtow.hxx
  6. //
  7. // Contents: Converts numbers to wide strings
  8. //
  9. // Notes: GetNumberFormat() requires a simple string for numbers.
  10. // The string can contain a L'-' as the first character, then
  11. // only digits and optionally one decimal place. Since we
  12. // know the constraints, we may as well do the formatting
  13. // ourseleves since we can do it faster
  14. //
  15. // History: 96/Jan/3 DwightKr Created
  16. // 96/Apr/4 dlee optimized and cleaned up
  17. //
  18. //----------------------------------------------------------------------------
  19. #pragma once
  20. extern void IDQ_ulltow_format( ULONGLONG val, WCHAR *buf, BOOL fIsNegative );
  21. extern void IDQ_ultow_format( ULONG val, WCHAR *buf, BOOL fIsNegative );
  22. inline void IDQ_lltow( LONGLONG val, WCHAR *buf )
  23. {
  24. IDQ_ulltow_format( val, buf, val < 0 );
  25. }
  26. inline void IDQ_ulltow( ULONGLONG val, WCHAR *buf )
  27. {
  28. IDQ_ulltow_format( val, buf, FALSE );
  29. }
  30. inline void IDQ_ltow( LONG val, WCHAR *buf )
  31. {
  32. IDQ_ultow_format( val, buf, val < 0 );
  33. }
  34. inline void IDQ_ultow( ULONG val, WCHAR *buf )
  35. {
  36. IDQ_ultow_format( val, buf, FALSE );
  37. }