Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 3 Jahren, 6 Monaten
Letzter Beitrag:
vor 3 Jahren, 6 Monaten
Beteiligte Autoren:
Peter Holemans, GuenterP, Fabrice Harari

WX19 - ChangeSeparator() and NumToString() don't work together

Startbeitrag von Peter Holemans am 10.12.2014 15:02

Hi,

For an international WB Application we have a requirement to generate formatted numbers based on local standards (South Korea, China, USA, France, Belgium, ...) depending on the context of the data (It is a single global WB web app installed on a European Windows 2008 Server).

According to the help ChangeSeparator() should be my friend in that case but NumToString doesn't take that into account. It will keep on looking to the Windows settings and discard any changes to the decimal and Thousand separator settings...

Is there a way to get this to work without having to write our own NumToString() function and developing ten times slower?

I already raised a call and added a sample project with Tech Support but this looks such a basic requirement that I would be surprised if am the only one that has already bumped into this.

So I'll be happy to take any suggestions or solutions out there!

Thanks,

Peter H.

Antworten:

Hi Peter

you need 3 lines of code (as you said it IS a basic requirement)
numtostring(yournumber)
replace(thousand separator by yours)
replace(decimal sign by yours)

all done

Best regards

von Fabrice Harari - am 10.12.2014 19:20
Hi Peter, there's still the possibility to build your own display masks depending on language / required settings.

von GuenterP - am 11.12.2014 07:32
Hi Fabrice,

Thanks... I should have found this myself...
I'll overload the NumToString function to as you suggested.
I just had a simple ChangeSeparator() at load time in mind but that should have been too simple, right?

:-) Thx again,

Peter H.

von Peter Holemans - am 11.12.2014 07:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.