Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
7

Problem with my calculations

Explorer ,
May 06, 2024 May 06, 2024

Hello, I am having some problems with the calculations for our GST on my form. The GST 50 column should take the GST from gst.1 divide by half first and then round down second. It only needs to round down if the number is not perfectly divisible by 2 though. so if I enter 16.06 which is an even number, as the GST it should round to 8.03 but its not, its rounding down to 8.02.  If I have say 5.27 that isn't easily divisible, the government pays the lower half, we pay the higher half, so I need that to round down to 2.62. 

 

I had to redo my calculations for the Receipt total, GST on receipt  km $ and Total meals columns to the sum method,  but it seems to have broken my calculation script and validation script when i did that. I have attached the file. 

 

Any assistance would be amazing!

TOPICS
General troubleshooting , How to , JavaScript , PDF , PDF forms
6.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 08, 2024 May 08, 2024

and yes if you can show me the changes that would be good, i need to learn this stuff so i can  stop bugging you all 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2024 May 08, 2024

That calculation already include your part?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 08, 2024 May 08, 2024

ok strange, this is how its calculating on my end in the sheet you sent me 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2024 May 08, 2024

I put your scripts back in "ProgramCostsRow" fields, now it will only calculate "GSThalf" fields.

https://drive.google.com/file/d/1KFIXSFdIVMNYB7kSvhNWFH8F3zZ6muuj/view?usp=sharing 

But from what I can see, your calculations in "ProgramCostsRow" fields may not be correct.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 08, 2024 May 08, 2024

I'm sorry I guess I am not understanding, when i open this one the GST 50 column no longer has a calculating field?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 08, 2024 May 08, 2024

I think I have figured it out...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 08, 2024 May 08, 2024
LATEST

Yes! It is calculating correctly, I have now changed all of that last section to read only, which is great now no one can type in there and break it! Thank you again so much for your help! 

 

So this is the only calculation needed in the GST 50 column? if(event.value == 0)event.value = ""; and you changed it to read only, was there anything I missed.?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines