You need to sign in to do that
Don't have an account?

setScale
Hello,
I need help with the following setScale, not sure why it's not working. I need to be able to set certain number fields with trailing 0. In this case I need a trailing 4 decimal places even if it's 0
quantity__c is Number(18, 0) (I had it set to 14,4..nothing changed)
m.quantity__c = (m.quantity__c).setScale(4);
The value would appear as ie. 10.0
If m.quantity__c was a string field I believe the setScale(4) works but i dont want to create unnecessary fields..
@davidjbb The fact that salesforce doesn't honor the scale setting (for values ending in zeros) in the database is an old issue that I previously documented here.
Hope this helps.
All Answers
m.quantity__c is a released field, I can't change it from Number to a String field.
@davidjbb The fact that salesforce doesn't honor the scale setting (for values ending in zeros) in the database is an old issue that I previously documented here.
Hope this helps.