简体   繁体   中英

Rails [AXLSX]: Change Currency

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?

Welcome to SO:)

Yo might try this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM