mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #14113 from cinaglia/fix-csv-decimal-places
Retain decimal precision when exporting CSV
This commit is contained in:
@@ -41,10 +41,8 @@ function formatSpecialHeader(useExcelHeader) {
|
||||
function formatRow(row, addEndRowDelimiter = true) {
|
||||
let text = '';
|
||||
for (let i = 0; i < row.length; i += 1) {
|
||||
if (isBoolean(row[i]) || isNullOrUndefined(row[i])) {
|
||||
if (isBoolean(row[i]) || isNumber(row[i]) || isNullOrUndefined(row[i])) {
|
||||
text += row[i];
|
||||
} else if (isNumber(row[i])) {
|
||||
text += row[i].toLocaleString();
|
||||
} else {
|
||||
text += `${QUOTE}${csvEscaped(htmlUnescaped(htmlDecoded(row[i])))}${QUOTE}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user