Adição das casas decimais

This commit is contained in:
2026-06-22 19:24:30 -03:00
parent 56b3e146bf
commit 74391d5a0c
6 changed files with 23 additions and 9 deletions

View File

@@ -17,9 +17,9 @@ module ApplicationHelper
link_to label, path, class: css
end
# Formata moeda BR
# Formata moeda BR (milhar com ".", decimais com ","): R$ 1.234,56
def moeda(valor)
"R$ #{"%.2f" % valor.to_f}".gsub('.', ',')
number_to_currency(valor.to_f, unit: 'R$ ', separator: ',', delimiter: '.', precision: 2)
end
# Badge de status de consolidação