Getting last two digits of a number

hi All
I just wanted to know that how we can get last two digits of a number. Like user writes 678 , so how to get 78 from that..

or this way

image

2 Likes

I got it but how to get the rest remaining digits like from 89003 if we extract 03, how will we get 890

I need help

You could have asked that in the first place!!

image

Works for 3 digit numbers up

1 Like

Assuming that Textbox1 is constrained to only accept numbers (there is a property that can be checked) the following I believe should also work

Here Label1 will show last two digits of a given number and Label2 will show the preceding numbers.
Am I misunderstanding the context?

4 Likes

Another algorithm to get last two digits of a number.

sdsdsdsds

3 Likes

Try to take the last two digits of 7.
Watch the text approaches fail

What do you mean by 7 ? 7 digits or just the number 7 ?

His point was that if you ask for 2 characters but the number is 7, you only have 1 character and the text block will misbehave.

I justified that....

Oh, I forgot some more counterexamples ...

  • -7
  • 3.1415926535...
  • 1 + sqrt(-1)