Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my locality we use a dot as a thousand separator an a comma for decimal.
i.e.
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='€#.##0,00;-€#.##0,00';
The number thirty thousand one hundred point 40 would be represented as:
34.100,40
This is correct so far. However, I have a map extension which expects numbers in the more "traditional" format of commas for thousands and point for the decimal part so 34,100.40 for the above number
I have a field (lets call it Lat) which arrives as a 7 digit number (e.g. 1234567) which need to be divided by 100000 and be saved as "12.34567")
I have tried:
= num#((1234567/100000), '#.#', '.', ',') and it does not appear to work - it always returns "12,34567"
any ideas
Alexis
Alexis
I tried the inverse - my regional settings are . for decimal and <space> for 000s, so I tried to make it display the other way round:
Environment:
SET ThousandSep=' ';
SET DecimalSep='.';
The expression
=num((1234567/100000), '#.#'')
returns 12.3
=num((1234567/100000), '#,#', ',', '.')
return 12,3
So one would think it should work for you in the opposite direction. Make sure you run the load to apply the environment settings. What version are you running?
Jonathan
Hi Jonathan
Yes your solution produced the desired result but I cannot change the regional settings universally in my application.
My requirement is driven by the fact that the mapping extension that I am using is expecting coordinates in the form 99.9999999
Thanks for helping out
Alexis
Hi Michiel,
The replace method is good but it creates a string field. I need to pass these values to an API (that expects 99.999999) as a numeric.
Thanks
Alexis
Strange, I changed my settings when testing.
Can you upload an example? Quite interesting that didn't work
Hi again Joe
What are your environment settings?
Alexis
Hi Alexis,
I just used the same set as yourself
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
Hi Alexis,
If you attach the sample file with your regional settings then it would be easier to give the solution for us.
Regards,
Jagan.
Hi Jagan
I created a new application and put everyone's suggestions on it - and voila!!
For some reason it was not working for me within the application that I am creating so my problem is elsewhere and not with the formatting..
Thank you Jagan and Jow for your suggestions/help
Alexis
Hi Joe
I created a new application (at Jagan's request) and put everyone's suggestions on it - and voila!!
For some reason it was not working for me within the application that I am creating so my problem is elsewhere and not with the formatting..
Thank you and Jagan for your suggestions/help
Alexis