You need to sign in to do that
Don't have an account?
Somasundaram Subramanian
currency field comparison
i have a currecny field type
how to compare the value of field is >0 using apex class please suggets
how to compare the value of field is >0 using apex class please suggets
To compare if a currency field value is greater than zero using Apex, you can simply use the greater than operator (>) in an if statement. Here's an example: In the above code, myObject represents the object that contains the currency field (CurrencyField__c). We store the value of the currency field in the currencyFieldValue variable.
We then use an if statement to compare the currencyFieldValue with zero using the greater than (>) operator. If the value is greater than zero, the logic within the if block will be executed. Otherwise, the logic within the else block will be executed.
If this helps , please mark this as Best Answer.
Thank you.
But its not working as expected if currency is USD then its skip even currency value shows USD0 but for EUR0 it works fine, is this issue due to currency field type in back end i checked the value it shows 0.00