Numbers above 9999 won't calculate HELP

payroll.aia (5.9 KB)
help plz :sob: :sob:

So I am making a program for my school project, and it is on making a payroll calculator.
There are designated values for taxes(deductions) depending on the amount of salary you get, and my programs works just fine on numbers until 9999, but when I try to calculate 10000 or more, it doesnt calculate properly. Does anyone know why? and any solutions plz?? Thanks!!!

It could be because of an empty else socket is there, please remove that.

Should it be like this?

Need to change comparisons block

1 Like

1 Like

Thank you so much!! i got to solve the problem!! by the way, is there a way to shorten this program? just curius..

1 Like

Please try this, perhaps it's short

Edit: There is no need for isNumber test, as you have already set to Numbers Only in design section

image

1 Like

If the TextBox is empty, you will get an error.

Correct, but if something would be there definitely would be number only, so empty check look more appropriate to me.

image

It's the same in this case.
grafik

I can not say both are same as far as computational resources are utilized, but yes, superficially both are same, since both involving equal number of computational steps.

Would a Numbers Only text box allow '.' as its Text value?

No, this is the error

image

for the operation
image

when input (EP.Text) is 12.5

image


thank you guys, anyways, i passed my work, idk if its ok, but still worked fine for me. THANK YOU VERY MUCH!! all your help is very much appreciated, I struggled so much just with that thing repeating over and over, and finally found this community HAHAHA

Earlier result could have been because of browser wasn't refreshed, here it's updated

Yes, it is allowing '.' as input.

Of course, but I think that you have now given the explanation yourself why it is better to use my logic (isNumber):

grafik

There could be empty String or Numbers Only, by nature input box is of type Text but we have just restricted it to Numbers. That's why it look good for me to do the isEmpty test.

Why don't you take a look at my blocks?
Then you see, if only "." was entered that an error occurs.
IsEmpty = false, but notIsNumber = true.

I think there is some communication error, Only '.' is different

from '12.5'

I wanted to say, it is allowing '.' in the form of 12.5 or as a floating point.

Sorry, I didn't notice this
image

No, at least not on my side.

And that's exactly what I'm talking about.