Forum Discussion
SClarke501
4 years agoFrequent Visitor
Converting visible numbers to plain text
Bit of a strange one but I can't figure out how to do this in Power Query. I have a column of decimal numbers, where I need to differentiate between things like 1.1 and 1.10 (1.10 wants to be tre...
- Anonymous4 years ago
Hi SClarke501 ,
You can use Number.RroundUp() to convert 2.29999999 to 2.3.
And the new column can be changed to text type.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ronrsnfld
4 years agoSuper User
For example, if you initially set your column to text (before doing any transformations), and your rule was that if the numbers after the decimal are in the set {1..12}, otherwise round to one digit, you could use this step in Power Query:
= Table.TransformColumns(#"Changed Type",
{"Column1", each if List.Contains(List.Transform(List.Numbers(1,12),each Text.From(_)),Text.Split(_,"."){1})
then _ else Number.ToText(Number.FromText(_),"0.0")})