user17443811
user17443811

Reputation: 165

Add custom abbreviation format for cells using AXLSX gem

I am using the caxlsx gem to export some data and I need to add custom abbreviation formatting for cells on a specific column to add units of T(trillions), B(billions), and M(millions) to the end. So:

I tried doing:

workbook = Axlsx::Workbook.new
sheet = workbook.add_worksheet
abbr = workbook.styles.add_style(format_code: '[>=1000000]0.0,,,"T";[>=1000]0.0,,"B";0"M"') #works in custom format when explicitly setting in excel 

which sends the data back and does download but when trying to open the file, it gives me We found a problem with some content in...

I've been at this for hours and can't seem to find a way. Any help is appreciated

Upvotes: 0

Views: 59

Answers (0)

Related Questions