Thousands Separator
-
How do you include a thousands separator in a C++ program. The separator:eek: will be used for input i.e., 2,000 and output i.e., 2,000. For now the input is more important. For example you will be prompted to enter Your Amount: $2,000.00. When I run this now the comma throws the whole calculation off.
-
How do you include a thousands separator in a C++ program. The separator:eek: will be used for input i.e., 2,000 and output i.e., 2,000. For now the input is more important. For example you will be prompted to enter Your Amount: $2,000.00. When I run this now the comma throws the whole calculation off.
(assuming you have a UI with somesort of edit box ) you need a masked edit that will do the job of converting the string to a valid number. http://www.codeproject.com/editctrl/#Masked+and+Validating+controls or maybe, just thinking about it, use some of the localization API, for example
GetNumberFormat
Maximilien Lincourt Your Head A Splode - Strong Bad