In Salesforce Apex, a Currency field stores monetary values as a Decimal data type. When you need to use that value as an Integer — for example, when adding it to an Integer list, performing integer arithmetic, or passing it to a method that expects an Integer — you must explicitly convert it using the Integer.valueOf() method. Note that this conversion truncates any decimal portion of the value (it does not round).
Use the Integer.valueOf() method to convert a Currency field value (stored internally as a Decimal) to an Integer.
For example, the AnnualRevenue field on the Salesforce Account object is a Currency field. To convert this value to an Integer, first query the field from the Account object, then call Integer.valueOf() on the returned value. The result can then be stored in an Integer variable or added to an Integer list.
The conversion returns only the whole-number portion of the value. For example, if AnnualRevenue is 5000.75, Integer.valueOf(5000.75) returns 5000.
This example is illustrative and may not satisfy all business needs. Modify it as required to fit your specific use case.
Account acc1 = [select AnnualRevenue from account where AnnualRevenue != null limit 1];
System.debug(‘Annual Revenue: ' + acc1.AnnualRevenue);
list<integer> quarterBonus = new list<integer>(1);
quarterBonus.add(0,integer.valueOf(acc1.AnnualRevenue));
system.debug('Quarter Bonus: ' + quarterBonus[0] );000387949

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.