This function reformats a numeric sequence to include grouping in the usual human readable format. "123456789" becomes "123,456,789", for example. The formatting is localized to the current running machine. In a German locale the previous example becomes "123.456.789". In a Hindi locale it becomes "12,34,56,789". Printing numbers for human consumption is a common request. C does not offer direct support for it, nor are there many examples that are complete for use outside of the US that I could find.
Programming takes discipline. Good programming takes a lot of discipline, a large number of principles, and standard, defensive ways of doing things right. No programming technique solves all problems. No programming language produces only correct results. No programmer should start each project from scratch
Showing posts with label Formatting numeric values with commas in C. Show all posts
Showing posts with label Formatting numeric values with commas in C. Show all posts
Subscribe to:
Posts (Atom)