Paul Rajs

Paul Rajs

  • NA
  • 641
  • 146.9k

How to add Zero(0) prefix and suffix in a value.(num or dec)

Jun 3 2016 2:01 AM
Hi Developers,
How to add zero(0) if the TextBox decimal value Length more than 1
My Reqiurements is as below

if TextBox value is =.1 should be insert as 00.10
if TextBox value is =1.0 should be insert as 1.00
if TextBox value is =1 should be insert as 1.00
if TextBox value is =1.000 should be insert as 1.00
if TextBox value is =0.1 should be insert as 0.10

if TextBox value is =1234 = should be insert as 1234
if TextBox value is =1234.22 = should be insert as 1234.22
if TextBox value is =1234.2= should be insert as 1234.20
if TextBox value is =1234.222 = should be insert as 1234.20

if the value decimal length is 1 or more than 1 na automatically add zero.
if Decimal value less than 2 or more than 2 digits
if 1.2 will be 1.20
if 1.222 will be 1.20 also

if i am done this task means my project is over.
I am tried but i cant able to get exact output.so anyone know please help me to how am done this task

thanking you
Paul.S

Answers (1)