mflaster
October 13th, 2002, 03:55 PM
Please forgive this off-topic post. I'm posting here because I think this would be a place where someone could answer my question very easily. And I can't figure out where else to ask!
I have an application that is trying to copy numbers to the windows clipboard. Let's say I have 90 1/3. I do:
sprintf(buf,"%.3f", x)
and buf gets "90.333". I then send that into the clipboard. If I paste that into an Excel spreadsheet in the US, that works fine. But in Europe, Excel is "smart", sees the '.' as the thousand seperator, and converts it to 90333.
What is the proper function to generate a string from a number, that would generate 90,333 in Europe? Would CString s.format("%.3f", x) do this?
For paste, I use 'atof' to convert back. Is there a corresponding function that will expect "90,333" in Europe and "90.333" in the US?
Thanks in advance!
Mike
I have an application that is trying to copy numbers to the windows clipboard. Let's say I have 90 1/3. I do:
sprintf(buf,"%.3f", x)
and buf gets "90.333". I then send that into the clipboard. If I paste that into an Excel spreadsheet in the US, that works fine. But in Europe, Excel is "smart", sees the '.' as the thousand seperator, and converts it to 90333.
What is the proper function to generate a string from a number, that would generate 90,333 in Europe? Would CString s.format("%.3f", x) do this?
For paste, I use 'atof' to convert back. Is there a corresponding function that will expect "90,333" in Europe and "90.333" in the US?
Thanks in advance!
Mike