How to format currency with commas in C

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
pocopito
Posts: 238
Joined: Tue Jul 12, 2011 1:31 pm

How to format currency with commas in C

Post by pocopito »

Hi all

In the last days I've been working with large numbers (perft tests) and when quantities go beyond then thousand it just becomes hard to me to compare them.
I searched for an easy way to add commas in C/C++ (or dots, depending on the locale I guess) and finally found this simple solution:




Regards

E Diaz
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
Rein Halbersma
Posts: 751
Joined: Tue May 22, 2007 11:13 am

Re: How to format currency with commas in C

Post by Rein Halbersma »