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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
schmidtj
Creator II
Creator II

Convert string to float | dynamic decimals

Hi,

i have numeraicl float data which i deen to convert to a lik float.

I used the #num() function and it works fine.

The problem is, that the number of decimals in my incomming data can vary (max. 2 decimals).

I can have numers linke this:

49

7101.1

2.88

0.1

0.34

When is use Num#(field, '#.##')  i cover all the data with 2 decimals but not the others.

What can i do to dynamically convert the data with one and two decimals?

Thanks a lot.

 

 

 

 

Labels (1)
3 Replies
sunny_talwar

Is this data not read as number already? If not, then may be try only this Num#(field)

schmidtj
Creator II
Creator II
Author

No unfortunately not.

Num#(field) is not working i'm afraid.

This will only convert the numbers without decimals in my case.

chriscammers
Partner Ambassador
Partner Ambassador

Are you looking for output where all the values have the same format?

Try Num(Field,'#.00') which will tweak the output format.