function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suji srinivasansuji srinivasan 

Manual calculation value contradicting the Formula outcome value

Hi,
total earnings=63,967
standard_deduction_monthly__c=4167
Professional_Tax__c=200
TDS__c=5333.33
Company_s_Contributionto_PF_Monthly__c=5400

for manual calculation i got  15100.33
In this formula i got   51566


CASE( Tax_Regime__c ,
"Old Regime",(Total_Earnings__c -( standard_deduction_monthly__c+Professional_Tax__c+Company_s_Contributionto_PF_Monthly__c+ TDS__c)), 
"New Regime",( Total_Earnings__c -TDS__c ) ,0)

can anyone guide me what went wrong?

Thanks in Advance

 
Best Answer chosen by suji srinivasan
SwethaSwetha (Salesforce Developers) 
HI Suji,
As Mukesh suggested, the result of the formula field is dependent on the datatype of the fields.

A similar scenario was reported here: https://salesforce.stackexchange.com/questions/334394/formula-field-multiplied-by-another-number-changes-the-decimal-value

You can use the ROUND function for the formula to round the values so that right result can be displayed.

Hope this helps. Thank you

All Answers

mukesh guptamukesh gupta
Hi Suji,

Before solution approach, firsty you need to share 

Total_Earnings__c =====>>>>> DataType?
standard_deduction_monthly__c  =====>>>>> DataType?
Professional_Tax__c             =====>>>>> DataType?
Company_s_Contributionto_PF_Monthly__c      =====>>>>> DataType?
TDS__c                 =====>>>>> DataType?


 
SwethaSwetha (Salesforce Developers) 
HI Suji,
As Mukesh suggested, the result of the formula field is dependent on the datatype of the fields.

A similar scenario was reported here: https://salesforce.stackexchange.com/questions/334394/formula-field-multiplied-by-another-number-changes-the-decimal-value

You can use the ROUND function for the formula to round the values so that right result can be displayed.

Hope this helps. Thank you
This was selected as the best answer
senies12 joesenies12 joe
Divide that result by the absolute exact value. Either with a calculator or by hand, divide the top number by the absolute value of your exact variable. In this ...mysainsburys (https://tractorsinfo.com/mysainsburys/)