Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 115967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:06:12+00:00 2026-05-11T03:06:12+00:00

I have been trying to use a formula that is used to work out

  • 0

I have been trying to use a formula that is used to work out exclusive VAT in a program that our team is creating. The formula works correctly when used in a calculator or in excel, though gives a different output when used within a function in our program!

here is the function:

function fn_calcVat()  {     var vRate = Ext.getCmp('crd_vat_rate').getValue();     var vTranAmt = Ext.getCmp('crd_tran_amt').getValue();      if (vRate != '' && vTranAmt != '')      {         alert(Ext.getCmp('vatable').getValue().toString());         var vAmt = 0;         if (Ext.getCmp('vatable').getValue().toString() == 'Y')         {             vAmt = (vRate / ((vTranAmt / 100) + 1));             Ext.getCmp('crd_vat_amt').setValue(vAmt.toFixed(2));             Ext.getCmp('crd_tran_tot').setValue(vTranAmt.toString());             vAmt = 0;         }         else          {             vAmt = ((vRate / 100) * vTranAmt);             Ext.getCmp('crd_vat_amt').setValue(vAmt.toFixed(2));             Ext.getCmp('crd_tran_tot').setValue((vTranAmt + vAmt));             vAmt = 0;         }                     } } 

the problem formula is vAmt = (vRate / ((vTranAmt / 100) + 1));

The other formula is working perfectly.

an example input would be 100 with a VAT rate of 14.00, and the expected answer would be a tax amount of 14, though it gives it as 7!!!

We are using a mashup of EXTJS, js and C#…

Any help would be greatly appreciated.

Kind Regards

Nick

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:06:13+00:00Added an answer on May 11, 2026 at 3:06 am

    The formula is incorrect, it should be

    vAmt = vTranAmt * (vRate / 100.0d); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use routes.rb for creating a URL /similar-to-:product (where product
I have been trying to figure out why and how to use performSelector. I
I have been trying to use JSON to store settings for a program. I
I have been trying to use Hibernate for a while. I like hibernate that
I have been trying to use the BigInteger type, that is supposedly new in
We have been trying to use virtual machines for build servers. Our build servers
I have been trying to figure out how to write a simple program to
I have been trying to use Android's AudioManager.setMicrophoneMute() without much success. That is, it
Hi I have been trying to work out the best way to do this
I have been trying to use the new validators that are now included with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.