Percent

Kind of class:public class
Package:org.casalib.math
Inherits from:none
Version:03/20/08
Author:Aaron Clinger, Mike Creighton
Classpath:org.casalib.math.Percent
File last modified: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

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
(read,write)

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

percentage

public percentage:Number
(read,write)

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