You need to sign in to do that
Don't have an account?
degmo
Number field type in apex
Hi,
I have a field defined as number(16,2). If I put in the value 0, SF UI shows 0.0 but in the database it is saved as 0 without the decimal points. I have a web application that integrates with SF and the web application passes me a value for this field as a string to filter. So, in my apex code, I need to do "double.valueOf(field)". However, if the web application passes me a "0", my SOQL won't return anything b/c it will convert it to 0.00 but it's stored as a "0" in the DB. How can I solve this problem?
I have a field defined as number(16,2). If I put in the value 0, SF UI shows 0.0 but in the database it is saved as 0 without the decimal points. I have a web application that integrates with SF and the web application passes me a value for this field as a string to filter. So, in my apex code, I need to do "double.valueOf(field)". However, if the web application passes me a "0", my SOQL won't return anything b/c it will convert it to 0.00 but it's stored as a "0" in the DB. How can I solve this problem?
Both queries result in the same data
select id,Test__c from Opportunity where Test__c = 0.00
select id,Test__c from Opportunity where Test__c = 0
Please mark this as the best answer if it helps
Thanks
Shubham Jain