View topic - equivalent of GetNumberFormat in QNX

equivalent of GetNumberFormat in QNX

General Help about QNX

equivalent of GetNumberFormat in QNX

Postby vipulbajaj » Mon Jan 04, 2010 1:39 pm

Hi,
I am porting a windows application to QNX. It uses a function GetNumberFormat() from windows. Is there any equivalent of this function in QNX?

Thanks.
vipulbajaj
New Member
 
Posts: 6
Joined: Fri Dec 11, 2009 12:33 pm

RE: equivalent of GetNumberFormat in QNX

Postby mario » Mon Jan 04, 2010 2:46 pm

Not that I know of.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: equivalent of GetNumberFormat in QNX

Postby maschoen » Mon Jan 04, 2010 5:12 pm

Do you know what the function does? From the sound of it, it seems close to trivial.
maschoen
QNX Master
 
Posts: 2724
Joined: Wed Jun 25, 2003 5:18 pm

RE: equivalent of GetNumberFormat in QNX

Postby vipulbajaj » Tue Jan 05, 2010 9:43 am

Suppose I have a number 10000. If the current locale settings are as per English standards, it would be written as 10,000. But if the locale settings are for Denmark, it would be written as 10.000.
The GetNumberFormat() function in Windows does this change as per the current locale setting.
I am looking for a function in QNX which will do this conversion. We can implement it using the function localeconv(), but the problem is that we may have to write a whole lot of code for all the locale settings.
So, is there any function available in QNX which can do this conversion and give the number in the desired format as the output.
vipulbajaj
New Member
 
Posts: 6
Joined: Fri Dec 11, 2009 12:33 pm

RE: equivalent of GetNumberFormat in QNX

Postby mario » Tue Jan 05, 2010 1:25 pm

Don`t think so
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby ingraham » Tue Jan 05, 2010 4:06 pm

You could use JNI to call Java code to do it.

-James Ingraham
Sage Automation, Inc.
ingraham
Senior Member
 
Posts: 161
Joined: Wed Nov 05, 2003 2:25 pm
Location: Texas

Postby mario » Tue Jan 05, 2010 11:06 pm

Is that a joke?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: RE: equivalent of GetNumberFormat in QNX

Postby rgallen » Wed Jan 06, 2010 1:05 am

vipulbajaj wrote:We can implement it using the function localeconv(), but the problem is that we may have to write a whole lot of code for all the locale settings.


I think you'll need to go the localeconv route. I don't think there should be much code to write, as localeconv does most of the work for you (gives you all the local number formatting symbols, your func just needs to stick them at the appropriate place, if they aren't NULL).
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest