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 raymondwkmok,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept as Solution" and give a 'Kudos' so other members can easily find it.
Thank you,
Pavan.