Hi everybody,
I'm trying to solve the issue with Excel opening CSV files with long numbers in scientific notation. I want the numbers to be preserved as they are.
I've read some stackoverflow threads on this topic and this is my last attempt to resolve the issue:
return Ok(new
{
CheckoutCardNumbers = checkoutCardNumbers.Select(x => new { NumAssign = "'" + x.NumAssign, x.Pin }),
CkdOutTo = ckdOutTo
});
(The NumAssign is a long number like this 6035242799000371 )
Unfortunately, the end result is ' appended to every value in the column and I just want to show them in Excel correctly.
Is there a simple way to still use ng-csv directive but not have this problem with Excel converting to scientific notation?
My button in the form looks like this:
<button type="button" class="btn btn-info"
ng-if="obj.exportCsv.export.length > 0"
id="btnConfirm" name="export"
ng-csv="obj.exportCsv.export"
csv-header="['CardNumber','Pin']"
filename="cardNumbers.csv"
ng-click="$close(obj.exportCsv.export)">
@Labels.save
</button>
Any ideas of how to solve the problem with Excel opening the file and converting long numbers into wrong format?
I think we just need to teach the users to do this
09/20/2019 NN: There is no simple way to fix it without breaking CSV file. The best way to overcome this problem may be this one
https://www.youtube.com/watch?v=0qiqcUKVlQI&app=desktopand consider this problem to be not an issue.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog