# Percent

Kind of class: public class org.casalib.math none 03/20/08 Aaron Clinger, Mike Creighton org.casalib.math.Percent Wednesday, 31 December 2008, 20:18:28
Creates a standardized way of describing and storing percentages. You can store and receive percentages in two different formats; regular percentage or as an decimal percentage.

If percent is 37.5% a regular percentage would be expressed as `37.5` while the decimal percentage will be expressed `0.375`.

## Summary

Constructor
• Percent (percentage:Number = 0, isDecimalPercentage:Boolean = true)
• Creates a new Percent.
Instance properties
• percentage : Number
• The percent expressed as a regular percentage.
• decimalPercentage : Number
• The percent expressed as a decimal percentage.
Instance methods
• equals (percent:Percent) : Boolean
• Determines if the percent specified in the percent parameter is equal to this percent object.
• clone
• toString : String

## Constructor

### Percent

public function Percent (
percentage:Number = 0, isDecimalPercentage:Boolean = true)

Creates a new Percent.
Parameters:
percentage :
Percent formated at a percentage or an decimal percentage.
isDecimalPercentage:
Indicates if the parameter `percentage` is a decimal percentage `true`, or regular percentage `false`.

## Instance properties

### decimalPercentage

public decimalPercentage:Number

The percent expressed as a decimal percentage. 37.5% would be expressed as `0.375`.

### percentage

public percentage:Number

The percent expressed as a regular percentage. 37.5% would be expressed as `37.5`.

## Instance methods

### clone

public function clone (

Returns:
• A new percent object with the same value as this percent.

### equals

public function equals (
percent:Percent) : Boolean

Determines if the percent specified in the `percent` parameter is equal to this percent object.
Parameters:
percent:
A Percent object.
Returns:
• Returns `true` if percents are identical; otherwise `false`.

### toString

public function toString (
) : String