---
title: percent()
slug: percent
docTags: 
createdAt: 2021-09-14T17:47:17.000Z
---

Given a value, returns that value as a `Percent`.&#x20;

### 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](docId\:FbN7bFaHlFPV4f1C53DxA)&#x20;

### 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](docId\:ucI5tCTfVBhonEJ6ZQijg)  | [Percent](docId\:FbN7bFaHlFPV4f1C53DxA)  | 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](docId\:FbN7bFaHlFPV4f1C53DxA)     | [Percent](docId\:FbN7bFaHlFPV4f1C53DxA)  | If a Percent value is passed, the same Percent value will be returned.                                                                                  |
| [String](docId\:Ujw2AQAktel5uukLuP73S)      | [Percent](docId\:FbN7bFaHlFPV4f1C53DxA)  | 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](docId\:N9trVqonnBknqL9DrNBP6)   | Unsupported data types return `Null`.                                                                                                                   |

