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

GST 50% rounding

Explorer ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

I have a sheet I have built where I am using this as a calculation for the tax to be extracted from a total amount.  (Tot1 / 105 *5 *.50) This works perfectly, however, I've just been told that if the amount comes out to say $4.05 GST dividing that by the 50% comes out to 2.5 cents, which isn't ok, so it has to be we get 2 cents from the government and we eat 3 cents. Not sure if that makes sense, let me try again....

 

The govt pays us back the lower amount in the GST, not the upper amount so we get 2.02 back. I only need the lower amount to show on my sheet not the $2.03 amount. As that is the number we will claim back. IS there a calculation that will do that?!

 

Ive included an attachment that shows whats being calculated now, the GST the total gst amount is actually 50% of the GST, total GST would be .45 what I need that column to read is .22 cents, we have to lose the .23 cents because we can't calculate it in half cause there are no  half cents. 

 

Help 😞

 

Thank you in advance!

 

 

TOPICS
General troubleshooting , How to

Views

325

Translate

Translate

Report

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 ,
Feb 01, 2023 Feb 01, 2023

Copy link to clipboard

Copied

So basically you want to round the result down, to the nearest hundredth, right?

Use this code as the field's custom Calculation script:

 

var v = Number(this.getField("Tot1").valueAsString) / 105 *5 *.50;
var nDecimals = 2;
event.value = Math.floor(v * Math.pow(10, nDecimals)) / Math.pow(10, nDecimals);

 

Votes

Translate

Translate

Report

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
New Here ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

LATEST

Excellent, thank you!

Votes

Translate

Translate

Report

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