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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display decimals without condensing or trailing zeros

Without formatting, numbers are condensing after 5 decimal places.

Decimals Condensed.PNG

Now I can format this to show all the numbers formatted to 10 decimal places, but I don't want the trailing zeros.

Decimals Trailing Zeros.PNG

Is it possible to do this with only formatting functions? I'd rather not use string functions to remove the excess zeros.

=ValueLoop(1,10)Desired Result
10.1
2

0.01

30.001
40.0001
50.00001
60.000001
70.0000001
80.00000001
90.000000001
100.0000000001

Thanks.

14 Replies
prat1507
Specialist
Specialist

=Num(0.00200, '##')

Not applicable
Author

Is this not the same as applying no formatting? I'm still getting e notation after 5 decimal places.

Decimals Condensed 2.PNG

prat1507
Specialist
Specialist

Apply Num(X,'##')

where X is expression used by you above as Num(1/pow(10,ValueLoop......,'#.#########')

prat1507
Specialist
Specialist

Use

=Num(0.00200, '(dec)')

Not applicable
Author

This seems like it technically should work, but it seems to be manipulating the actual results somehow.

Decimals (dec).PNG

prat1507
Specialist
Specialist

Use this

=Num(1/pow(10,ValueLoop(1,10)),'#.'&Repeat('#',ValueLoop(1,10)))

Not applicable
Author

Thanks Pratyush, but I need a way to format the decimals in general, not just for this valueloop example.

Not applicable
Author

Unfortunately, I think I'm going to have to use string functions to remove the trailing zeros.

This is the best I could come up with:

Replace(RTrim(Replace(Num(1/pow(10, ValueLoop(1,10)),'#.##########'),'0',' ')),' ','0')

Decimals Trailing Zeros Removed.PNG

sunny_talwar

Try this may be

=Num(Num(1/pow(10, ValueLoop(1, 10)), '##.##############'), '##.' & Repeat('#', FindOneOf(Mid(Num(1/pow(10, ValueLoop(1, 10)), '##.##############'), Index(Num(1/pow(10, ValueLoop(1, 10)), '##.##############'), '.')), '123456789', -1)-1))

Capture.PNG