Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

setting a default place for decimals

$
0
0
i have a textbox, named txtPPrice.text where in you can only input numbers.

i want that textbox to convert integers into decimals onleave.

i.e
i input 150
onleave the output should be 1.50

another i.e
i input 10025
onleave the output should be 100.25

as you can see, the last two digit became the decimals.

here is my first lines of code:
Dim a As Decimal
        a = txtPPrice.Text



and i don't know what would be next.

at first i used this code:
If txtPPrice.Text <> "" Then
txtPPrice.Text = txtPPrice.Text & ".00"
End If



but then, i don't achieved the goals i want.
i hope for some help.
ty

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>