+ Start a Discussion
GYAN ANDRUSGYAN ANDRUS 

can anyone please help me for this Invalid Decimal: 100 in apex class

I am reading csv file using apex class ,,I am getting error as Invalid Decimal

 Amount  = csvRecordData[0];
             System.debug('The Amount value is : '+Amount );
             
             Decimal decVal = Decimal.ValueOf(Amount);
             accObj.Transaction_Amount__c = decVal;
             
            System.debug('The value issssssssssssssssss: ' +decVal);
                         
             acclist.add(accObj);  
Amit Chaudhary 8Amit Chaudhary 8
Try to update your code like below
Amount  =  Decimal.ValueOf(csvRecordData[0]);
             System.debug('The Amount value is : '+Amount );
             Decimal decVal = Decimal.ValueOf(Amount);
             accObj.Transaction_Amount__c = decVal;
			 System.debug('The value issssssssssssssssss: ' +decVal);
             acclist.add(accObj);