If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Export Number to CSV with 2 Decimals

Started by dpccgf, 17 Jul 2018 02:56:24 PM

Previous topic - Next topic

dpccgf

Is there a way to have a number exported to CSV always contain 2 decimal places?  Example, 1115.1 would export as 1115.10, 23 would export as 23.00.  Reporting formatting works fine and exporting to Excel works fine.  I just need the same formatting to be applied to the CSV file.  If it cannot be done via something in the report, can it be formatted in Framework Manager as a number with two decimal places then when the package is published and the report run it works?  TIA

sdf

#1
have you tried format masking?
or if possible convert the values to string.

dougp

CSV is just values, not formatting.  In your data item, you can cast to a character data type and format it.  This may produce the correct output in CSV.  Unfortunately, if you plan to open the CSV in Excel you're out of luck.  Excel doesn't know how to properly read a CSV.  It will likely convert it back to a number and bork your formatting.