Skip to content

bigfunctions > format_percentage

format_percentage

Signature

format_percentage(first_number, second_number, nb_decimals)

Description

Return first_number / second_number as a formatted percentage in a user-friendly format. You can use this function to handle a safe divide of the two numbers as well as your desired level of rounding.

Examples

select bigfunctions.eu.format_percentage(1, 3, 2)
select bigfunctions.us.format_percentage(1, 3, 2)
select bigfunctions.europe_west1.format_percentage(1, 3, 2)
+----------------------+
| formatted_percentage |
+----------------------+
| 33.33 %              |
+----------------------+