Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
alexis
Partner - Specialist
Partner - Specialist

Commas and dots formatting

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

18 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
alexis
Partner - Specialist
Partner - Specialist
Author

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

alexis
Partner - Specialist
Partner - Specialist
Author

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

Not applicable

Strange, I changed my settings when testing.

Can you upload an example? Quite interesting that didn't work

alexis
Partner - Specialist
Partner - Specialist
Author

Hi again Joe

What are your environment settings?

Alexis

Not applicable

Hi Alexis,

I just used the same set as yourself

SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';


jagan
Partner - Champion III
Partner - Champion III

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.

alexis
Partner - Specialist
Partner - Specialist
Author

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

_delete.jpg

alexis
Partner - Specialist
Partner - Specialist
Author

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

_delete.jpg