Website logo
Navigate through spaces
ChartHop documentation
⌘K
ChartHop Help Center
Getting around in ChartHop
ChartHop for Employees
Implementing ChartHop
ChartHop for Administrators
Carrot reference
ChartHop for Developers
Partners
Release notes
Resources
Docs powered by Archbee
Website logo
Carrot reference
...
Elements of Carrot expressions
Functions

percent()

Given a value, returns that value as a Percent.

Syntax

percent(value[, places])

  • value - the Number, Percent, or String value to be converted to a Percent.
  • places - the number of decimal places of the returned Percent value.
  • Return type: Percent

Sample usage

percent(50/100) returns 50%.

percent(0.75) returns 75%.

percent(0.5667777, 3) returns 56.678%.

Supported data types

Input type

Return type

Logic

Number

Percent

If a Number value is passed, a Percent will be returned only if the Number value is represented using division, ex. 50/100, or if it is a decimal.

Percent

Percent

If a Percent value is passed, the same Percent value will be returned.

String

Percent

If a String value is passed a Percent will be returned only if the String value can be converted to a Number value, and that Number value is a decimal.

Unsupported data types

Null

Unsupported data types return Null.



Updated 04 Oct 2023
Did this page help you?
PREVIOUS
pluralize()
NEXT
random()
Docs powered by Archbee
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types
Docs powered by Archbee