Commit 4f95ee8c by Deep Singh Committed by kevalbhatt

ATLAS-3964: Atlas UI displays large numbers incorrectly #1

Signed-off-by: 's avatarkevalbhatt <kbhatt@apache.org>
parent 45bb769f
......@@ -46,7 +46,7 @@ define(['require', 'utils/Utils', 'lossless-json', 'marionette', 'backgrid', 'as
converters: _.extend($.ajaxSettings.converters, {
"text json": function(data) {
try {
return LosslessJSON.parse(data, function(k, v) { return (v.isLosslessNumber) ? v.value : v });
return LosslessJSON.parse(data, function(k, v) { try { return (v.isLosslessNumber) ? v.valueOf() : v } catch (err) { return v.value } });
} catch (err) {
return $.parseJSON(data);
}
......
......@@ -46,7 +46,7 @@ define(['require', 'utils/Utils', 'lossless-json', 'marionette', 'backgrid', 'as
converters: _.extend($.ajaxSettings.converters, {
"text json": function(data) {
try {
return LosslessJSON.parse(data, function(k, v) { return (v.isLosslessNumber) ? v.value : v });
return LosslessJSON.parse(data, function(k, v) { try { return (v.isLosslessNumber) ? v.valueOf() : v } catch (err) { return v.value } });
} catch (err) {
return $.parseJSON(data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment