|
From: Zodiaq <zo...@ac...> - 2003-11-03 22:55:22
|
Hello all Dev-cpp-users, is there a way to force treting , in numbers as . ?? In Poland there is a strange habit of writing numbers this way: number,fraction 13,75 no usual: number.fraction 13.75 using ifstream extraction loses fraction value... there is way to read line, and replace each , with . then use istringstream on in and at last use normal extraction... lot of work - maybe there is other simplier way?? -- regards Zodiaq |
|
From: Per W. <pw...@ia...> - 2003-11-04 01:02:41
|
For most modern c/c++ libraries it should be enough to change locale (setlocale in ANSI/POSIX) before using the input/output functions. The normal C locale is hard-coded to a dot as decimal separator. /Per W On Mon, 3 Nov 2003, Zodiaq wrote: > Hello all Dev-cpp-users, > > is there a way to force treting , in numbers as . ?? In Poland there is a > strange habit of writing numbers this way: > number,fraction 13,75 > no usual: > number.fraction 13.75 > > using ifstream extraction loses fraction value... there is way to read line, > and replace each , with . then use istringstream on in and at last use > normal extraction... lot of work - maybe there is other simplier way?? > > -- > regards Zodiaq > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Maya <Esc...@ne...> - 2003-11-04 03:20:42
|
Yes, I know exactly what you are talking about. C++ has already solved this problem with the use of locales and facets, but that is not related to Dev-cpp. However, there is a book that will help you, is called "Standard C++ IOStreams and Locales" isbn: 0-201-18395-1. I am right now working on a class called Money, it addresses problems like the one you are having. Let me know if you need any help, I would more than glad to help! zo...@ac... wrote: >Hello all Dev-cpp-users, > > is there a way to force treting , in numbers as . ?? In Poland there is a >strange habit of writing numbers this way: >number,fraction 13,75 >no usual: >number.fraction 13.75 > >using ifstream extraction loses fraction value... there is way to read line, >and replace each , with . then use istringstream on in and at last use >normal extraction... lot of work - maybe there is other simplier way?? > > > -- Jorge Escalante FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
|
From: Maya <Esc...@ne...> - 2003-11-04 03:46:03
|
I have installed FLTK in the 'C:\cygwin\usr\include\FL' folder, but I don't know how to make Dev-C++ find the new library. Can anyone help? TIA zo...@ac... wrote: >Hello all Dev-cpp-users, > > is there a way to force treting , in numbers as . ?? In Poland there is a >strange habit of writing numbers this way: >number,fraction 13,75 >no usual: >number.fraction 13.75 > >using ifstream extraction loses fraction value... there is way to read line, >and replace each , with . then use istringstream on in and at last use >normal extraction... lot of work - maybe there is other simplier way?? > > > -- Jorge Escalante FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
|
From: Vlada D. <dj...@im...> - 2003-11-04 07:14:47
|
You should link your library in the project.(Project->Project = Options->LinkerOptions) Add a line like=20 -lfltk(or whatever your library is called). Library names are like = libfoo.a, but you should strip the starting "lib", so you should write = -lfoo. ----- Original Message -----=20 From: Maya=20 Cc: Dev...@li...=20 Sent: Tuesday, November 04, 2003 7:51 AM Subject: Re: [Dev-C++] locale , to . I have installed FLTK in the 'C:\cygwin\usr\include\FL' folder, but I = don't know how to make Dev-C++ find the new library. Can anyone help? TIA zo...@ac... wrote: Hello all Dev-cpp-users, is there a way to force treting , in numbers as . ?? In Poland there = is a strange habit of writing numbers this way: number,fraction 13,75 no usual: number.fraction 13.75 using ifstream extraction loses fraction value... there is way to read = line, and replace each , with . then use istringstream on in and at last use normal extraction... lot of work - maybe there is other simplier way?? =20 --=20 Jorge Escalante FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the=20 power to make the innocent guilty and to make the guilty=20 innocent, and that's power.=20 - Malcom X * "Innocent until proven guilty", no... not in Canada!! |