Number conversion

hey all,
i want to give an input a string as “2.07”
output should be “2.070”

another example
input:2.789
output:2.789

input:2.1
output:2.100

hope all of them understands the problem

1 Like

Yah like this
IF(variable.ToString.Contains(“.”),Split(variable1.ToString,“.”)(0)+“.”+Split(variable1.ToString,“.”)(1).PadRight(3,CChar(“0”)).ToString,variable1.ToString)

Cheers @emm

Hi @emm

Use format value activity and pass the value and give decimal with 2

Thanks
Ashwin.S

Main.xaml (4.7 KB)

Please check this not getting the result

1 Like

i modified the expression buddy
kindly check with this
Split(variable1.ToString,“.”)(0)+“.”+Split(variable1.ToString,“.”)(1).PadRight(3,CChar(“0”)).ToString

CHeers @emm

buddy this one is working
but if the input is “2” it is throwing error

1 Like

awesome then include a IF like this inn a assign activity
str_output = IF(variable.ToString.Contains(“.”),Split(variable1.ToString,“.”)(0)+“.”+Split(variable1.ToString,“.”)(1).PadRight(3,CChar(“0”)).ToString,variable1.ToString)

Cheers @emm

now the output is “2” not getting “2.000”

so you want that also decimal points
if so
str_output = IF(variable.ToString.Contains(“.”),Split(variable1.ToString,“.”)(0)+“.”+Split(variable1.ToString,“.”)(1).PadRight(3,CChar(“0”)).ToString,variable1.ToString+“.000”)

@emm

Can it functioned through the format function

Can it be functioned through the format function

input 2.1 to numA

numA.ToString(“0.000”)