Calculate numbers which are in textbox1,textbox2,etc

These should get you started.
B15
B13
B10
formulas.aia (2.5 KB)

Use the blue mutator button to add sockets.

https://appinventor.mit.edu/explore/ai2/support/concepts/mutators

P.S.
There is a right click option on most blocks to switch it to external input, which shows nesting better than those internal sockets.

Formatting a fractional number to 2 places is typically done with dollars and cents in the US.

How do you show fractional amounts of money in your country?

taxcalculator.aia (165.6 KB)
i did it today but the answers are coming different i think B3,B5,B10 values are not in percentage it should be in percentage thats why result is wrong also decimal is not coming ex:2459 instead of 24.59
please look in the aia file i attached also how can i send excel file to you so can see te actual result
one thing is you have in b15 block put 0.18 will it be 18 or 0.18

@buyzilla
Your Design panel and blocks are empty. Contains only one VerticalArrangement1

1 Like

grafik

1 Like

borrar_textbox.aia (2.3 KB)

Sir select calculator screen in drop-down there you find design and blocks

Try this one and post at least one or two examples (screenshots) of the results and what the results should be: taxcalculator2.aia (167.4 KB)

1 Like

You seem to be having trouble with percentages.

In Excel, you can format a column or cell as a percentage.
This has the effect of showing 100 times the fractional value and JOINing a '%' after it to show it is a percentage.

AI2 does not have a native percentage data type or any such formatting capability.
It only stores percentages as the fractions that they really are, like 0.18

Does this explanation help?

1 Like

I already showed one way of handling numbers as percentage here (above):

2 Likes

I am going to assume your app is working in rupees (text)
since you use 18% and 'GST' and are exceptionally polite to us.

From looking at your Designer
Designer
your label text lacks sufficient detail to express the units (rupee vs pure number vs percentage of WHAT(PP?)) of the associated text input.

You have 3 text boxes that are in percentages (B3, B5, B10), but you fail to do the required divide by 100 in the value procedures for those numbers.
Designer

Here is my take on a fix, with some non-numeric cleanup added as a separate pass over the inputs ...



B3
B5
B10
taxcalculator (1).aia (166.7 KB)

4 Likes

hello again,
yes sir i am working on rupee (INR)
I have given link below for excel file so you can calculate result yourself also ive done one mistake in Total expenses formula at B18 it will be B12 INSTEAD OF B5+B6+B7+B8+B9+B13+B14+B15 THIS IS WRONG
B12+B6+B7+B8+B9+B13+B14+B15 THIS IS RIGHT

https://docs.google.com/spreadsheets/d/1vBLi_wHvuNfLrJZjG2nXU5p0QA2JdQ1U/edit?usp=sharing&ouid=102092703762048461106&rtpof=true&sd=true

hi,
i did it but result is correct in B12 AND B14 only rest are different answers
taxcalculatorrevised.aia (167.3 KB)
see results yourself in excel sheet link is
TAX CALCULATOR EXCELOK.xlsx - Google Sheets

Check your formulas carefully. These are not correct.

yes you were right i mistaken in formula thank you mam

OMG! It is working as I wanted and calculations are correct thank you all admins
would ask one last favour I need three solutions
1, when we enter value in textbox and on keyboard when click enter it would go to next box.
2, is there any way that all calculations after putting values updates realtime without clicking calculate button.
3. How to round off result,and I can't align all my textbox and labels straight I used label as space in editor it shows straight but in mobile it crumbles

Not sure about keyboard enter key - you can have a 'submit' button.
Make a Block List of all those Text Boxes, in the same order as they are displayed. When the submit button is tapped, it can set the focus to the next TextBox in the List.

Not a good idea - if you want to do it, the code will have to check which values are already entered and calculate only a semi-result, due to the dependency of the calculations. There is no real advantage in doing that.

You can round (nearest) or ceiling or floor

ROUND

Put them in Arrangements and ensure all the text boxes are sized the same in % and all the labels are sized the same in %

Some GUI tips:
https://www.professorcad.co.uk/appinventortips#TipsGui

Set the Labels to right align:
LABEL SETTINGS

... and ensure you specify the Font Typeface and size

Same goes for the text boxes but you probably want to left align them.