Class “Percent”

Object > Percent

Represents a percentage. See also PercentValue

Type: Percent extends Object
Constructor: public
Singleton: No
Namespace: tabris
Direct subclasses: None
JSX Support: No


new Percent(value)

Parameter Type Description
value number A number between and including 0 and 100



Returns a string representation of the percent (a number followed by ‘%’).

Returns: string


Returns the percent number

Returns: number

Static Methods


Creates a new instance of Percent using any valid percent expression. For any other value, including null the method throws.

Parameter Type Description
percentValue PercentValue The value to create a Percent instance from

Returns: Percent


Returns true if value is a valid PercentValue. This excludes null. Use this to check if a value will be accepted by Percent.from. This is also a valid TypeScript type guard function.

Parameter Type Description
value any The value to test

Returns: value



A number between and including 0 and 100

Type: number
Settable: No

This property can only be set via constructor. Once set, it cannot change anymore.