I know this is an old thread, but in case anyone stumbles across it like I did, this solution should also work, with the caxlsx gem (https://rubygems.org/gems/caxlsx):
# I discovered the 'num_fmt' usage in this source_code file:
# https://github.com/caxlsx/caxlsx/blob/946f287a37c7a5d2b4fe2ae8d109848e257241b1/lib/axlsx/stylesheet/num_fmt.rb
xlsx_package = Axlsx::Package.new
wb = xlsx_package.workbook
currency_style = wb.styles.add_style({num_fmt: 8})
The 'format_code' option wb.styles.add_style(format_code: "$#,##0.00;[Red]$-#,##0.00")
didn't work for my use-case. My spreadsheet reader (LibreOffice) would only recognize that option as a 'custom' formatted cell, not a 'currency' cell.
edit: They did use it in one of their examples.
https://github.com/caxlsx/caxlsx/blob/946f287a37c7a5d2b4fe2ae8d109848e257241b1/examples/number_format_example.md