Forum Discussion
raymondwkmok
1 year agoFrequent Visitor
How to use Text.Format for setting a single digit number to doble digit format
Hi there, I'd like to set the numbers in a cloumn to fixed 2-digit format and used the following formula in Power Query but got an error. #"Set 2 Digit" = Table.TransformColumns(#"Changed Type4...
- 1 year ago
Hi raymondwkmok
Number.ToText is the appropriate function if you want to convert a number to a 2-digit text representation.
I would suggest changing the code for this step to:
#"Set 2 Digit" = Table.TransformColumns(#"Changed Type4",{"Leak Sensor", each Number.ToText(_, "00"), type text})Does this work for you?
- 1 year ago
Hi raymondwkmok You could also try Text.PadStart , Text.From. Try this:
=Table.TransformColumns(#"Changed Type", {{"Leak Sensor", each Text.PadStart(Text.From(_), 2, "0"), type text}})Hope this helps!!
Anonymous
1 year agoNot applicable
Hi @tongnghi,
I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.
Please continue using Microsoft community forum.
Thank you,
Pavan.