babel icon indicating copy to clipboard operation
babel copied to clipboard

format_percent doesn't return trailing decimal zeros with precision

Open hshercha opened this issue 3 years ago • 1 comments

Overview Description

Even when decimal_quantization=False, format_percent doesn't return decimal zeros with precision. Is it possible to include another flag to specify the number of precision values? We are using this for localizing interest rates.

Steps to Reproduce

  1. Call format_percent with any number that would yield a whole number.

Actual Results

format_percent(0.23, locale=en_US, decimal_quantization=False) -> 23% format_percent(0.234, locale=en_US, decimal_quantization=False) -> 23.4%

Expected Results

format_percent(0.23, locale=en_US, decimal_quantization=False) -> 23.00% format_percent(0.234, locale=en_US, decimal_quantization=False) -> 23.40%

Reproducibility

Additional Information

hshercha avatar Jul 08 '22 17:07 hshercha

This is more of a feature request than a bug

hshercha avatar Jul 08 '22 17:07 hshercha