add percent format

This commit is contained in:
Pete Matsyburka
2026-05-15 20:07:29 +03:00
parent e52830c9b4
commit 99ca0136ed
6 changed files with 47 additions and 21 deletions
+4
View File
@@ -25,6 +25,10 @@ module NumberUtils
ApplicationController.helpers.number_to_currency(number, locale:, precision: 2, unit: CURRENCY_SYMBOLS[format])
elsif locale
ApplicationController.helpers.number_with_delimiter(number, locale:)
elsif format == 'percent'
"#{number}%"
elsif format == 'percent_space'
"#{number.to_s.tr('.', ',')} %"
else
number
end