Printing integers with thousands separators in Windows using C

前端 未结 2 1448
萌比男神i
萌比男神i 2021-01-16 10:38

The question is pretty self-explanatory, I suppose. I am using printf and friends (snprintf etc) to display some memory statistics that are in the millions or hundreds-of-th

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-16 11:29

    Use GetNumberFormatEx (for Windows Vista and later). The option LOCALE_NAME_USER_DEFAULT uses the preferences set in the Control Panel under regional and language options, including a thousands seperator.

提交回复
热议问题