Class “Percent”

Object > Percent

Represents a percentage. See also PercentValue

Constructor public
Singleton No
Namespace tabris
Direct subclasses None
JSX support No


new Percent(value)

Parameter Type Optional Description
value number No 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 Optional Description
percentValue PercentValue No 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 Optional Description
value any No The value to test

Returns value is PercentValue



A number between and including 0 and 100

Type number
Settable No
Change events No

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