Rails [AXLSX]: Change Currency

237 Views Asked by At

I need to change the currency format on an Excel file that is exported. The default currency pattern is US (1,000.00) [One Thousand] and I need it to become PT-BR format (1.000,00) [One Thousand].

I have tried implementing this way:

    formated = workbook.styles.add_style(format_code: '$#.##0,00')

but the only thing it did, was add more zeroes after the .

How should I do it?

1

There are 1 best solutions below

3
borjagvo On BEST ANSWER

Welcome to SO :)

Yo might try this:

formated = workbook.styles.add_style(:format_code => '#.###,##')