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
Suraj DemgundeSuraj Demgunde 

When i fire this trigger getting class error because Quote.Net_Amount_in_Text__c = enw.convert(Quote.Total_After_VAT__c); value is likw 1230.00 so gave decimal error now i want this trigger value as only 1230 how it is possible ?

trigger SVMXUPG_convertNumberToWord on SVMXC__Quote__c (before insert, before update) {
    EnglishNumberToWords enw = new EnglishNumberToWords();
    for(SVMXC__Quote__c Quote: Trigger.new){
        Quote.Net_Amount_in_Text__c = enw.convert(Quote.Total_After_VAT__c);
    }
}
 
Suraj DemgundeSuraj Demgunde
help me guys its very urgent
v varaprasadv varaprasad
Hi Suraj,

please check once below snippet code : 
decimal deciml = enw.convert(Quote.Total_After_VAT__c);
if(deciml != null){
 integer amt = deciml.intValue();
 Quote.Net_Amount_in_Text__c = amt;
}


Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com