after get text the number has 1 or 2 digit, how can i add “0” if there is only 1 digit
For example
2155,9 has only one digit after “,” so i want to add “0” if is it the case
after get text the number has 1 or 2 digit, how can i add “0” if there is only 1 digit
For example
2155,9 has only one digit after “,” so i want to add “0” if is it the case
i need this “you want output as 2 155,90”
Hi @Soudios
Try this
InputText="2155,9"
String.Join(",", InputText.Split(","c).Select(Function(part) If(part.Length = 1 AndAlso Char.IsDigit(part(0)), part & "0", part)))
Hope this helps!!
booloutput=system.text.RegularExpressions.Regex.IsMatch(inputstr,“\d+\s\d+,\b\d{1}\b”)
gives true if there is any single digit
check this once
Hi @Soudios
Try this:
text="2155,9"
text = String.Join(",", text.Split(","c).Select(Function(x) If(x.Length = 1, "0" + x, x)))
Hope it helps!!
its not worlking well
the zero needs to be at the end not before the last number
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.