Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
peschu123
Partner - Creator III
Partner - Creator III

Format a number with num() to use ' as separator in textbox

Hi,

I use a Textbox to show a value.

The Value is something like "10123456" and I want it formatted like this: "T€ 10'123"

I played around with num() but the main problem is the ' (apostrophe) ...

I hope somebody can help me out.

Best Regards,

Peter

1 Solution

Accepted Solutions
rbecher
MVP
MVP

= num(round(sum({<[field1]={0}>} Costs) / 1000)), 'T€ #''##0', '.', chr(39))

Astrato.io Head of R&D

View solution in original post

16 Replies
Not applicable

Hi

the best is you set your format in tab 'number'  and copy it in your text box

best regards

Chris

peschu123
Partner - Creator III
Partner - Creator III
Author

I tried that, but it doesn't work because of the apostrophe .. is there a way to escape this sign? chr(39) doesn't work inside num() too.

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

something like

num(10123456, 'T€ #''##0','.',chr(39)) ?

marcus_sommer

Try this:

= replace(num(10123456 / 1000, 'T€ #.##0'), '.', chr(39))

- Marcus

rbecher
MVP
MVP

Or this:

= num(floor(10123456 / 1000), 'T€ #'&chr(39)&'##0', '.', chr(39))

Astrato.io Head of R&D
peschu123
Partner - Creator III
Partner - Creator III
Author

Ok I got it working.

The best shot came from marcus, but I needed to change it a little bit to:

=replace(num(Sum({<[field1]={0}>}Costs)/1000, 'T€ #.##0',',','.'), '.', chr(39))

rbecher
MVP
MVP

..or better round than floor.

Astrato.io Head of R&D
rbecher
MVP
MVP

But, you don't need replace..

Astrato.io Head of R&D
peschu123
Partner - Creator III
Partner - Creator III
Author

Yes!

It works very well, but floor leads to slightly wrong results...