Newer Version Available
Integer Class
Contains methods for the Integer primitive data type.
Namespace
Usage
For more information on integers, see Integer Data Type.
Integer Methods
The following are methods for Integer.
format()
Returns the integer as a string using the locale of the
context user.
Signature
public String format()
Return Value
Type: String
Example
valueOf(fieldValue)
Converts the specified object to an Integer. Use this method to convert a history
tracking field value or an object that represents an Integer value.
Signature
public static Integer valueOf(Object fieldValue)
Parameters
- fieldValue
- Type: Object
Return Value
Type: Integer
Usage
Use this method with the OldValue or NewValue fields of history sObjects, such as AccountHistory, when the field type corresponds to an Integer type, like a number field.
Example: