How to place currency symbol to left of value in excelHtml5 export?

How to place currency symbol to left of value in excelHtml5 export?

nportnport Posts: 23Questions: 6Answers: 0

http://live.datatables.net/zujepiku/2/edit

Similar questions have appeared a couple times on this forum, but now that some years have passed I would like to know if there is a solution / better workaround.

Basically when creating report generations using DataTables excelHtml5 button, if you are displaying currency values the currency symbol ($) appears to the right of the value when exporting to excel. I want to know how you can display the currency symbol on the left of the value as this is what most people are used to when viewing currencies.

I have attempted a couple solutions but there doesn't seem to be a simple way, in the example I linked I tried to just change the cell style to plain text but for some reason the currency symbol disappears when you apply this style?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

  • nportnport Posts: 23Questions: 6Answers: 0

    @colin the reply posted by @NET247 in that thread solved my issue. Thanks

    customize: function( xlsx ) {
                    $(xlsx.xl["styles.xml"]).find('numFmt[numFmtId="164"]').attr('formatCode', '[$$-en-AU]#,##0.00;[Red]-[$$-en-AU]#,##0.00');
    }
    
Sign In or Register to comment.