"Infinity"

Answered
David Chen asked on April 22, 2016

Is there a way to format the "Infinity" value to like 0 or blank
right now my format is
SyntaxEditor Code Snippet

formats: [ {Name: '',thousandsSeparator: ',',decimalSeparator: '.',decimalPlaces: 0, nullValue: ''} ],
  expandAll: true,
  showHeaders: false
};

7 answers

Public
Roman Petrusha Roman Petrusha Flexmonster April 23, 2016

Hi!

Yes, it's possible.
Please modify your sample like this
formats: [ {Name: '',thousandsSeparator: ',',decimalSeparator: '.',decimalPlaces: 0, nullValue: '', infinity: "Infinity"} ],
expandAll: true,
showHeaders: false
};

Here is a working sample https://jsfiddle.net/vsk1fLq4/6/

Public
David Chen April 23, 2016

I don;t think its working. Still showing Infinity when I want to change into "Over"
 
calculated: true, formula: "if( sum('Quantity') > 200 , sum('Price'), sum('Price) / 0 )", active: true}],
formats: [{name: "", infinity: "Over"}]

Public
Roman Petrusha Roman Petrusha Flexmonster April 25, 2016

Hi!

Please note that Infinity value and Division by Zero are treated as the different values.

Probably you have to try the following syntax: formats: [{name: "", infinityValue: "over", divideByZeroValue: "DIV/0"}]

Does it help?

Public
David Chen April 25, 2016

I tried the code in the example in jsfiddle, its not working
 
can you put it in jsfiddle?

Public
David Chen April 25, 2016

I tried the code in the example in jsfiddle, its not working
 
can you put it in jsfiddle?

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster April 25, 2016

Hello David,

Here is a jsfiddle example with number format with defined infinityValue and divideByZeroValue: https://jsfiddle.net/irynakulchytska/5nuomfL6/
As Roman already said, please note that Infinity value and Division by Zero value are treated as different values.
 
Please let me know if the sample works for you.
 
Kind regards,
Iryna

Public
Tanya Gryshko Tanya Gryshko Flexmonster December 7, 2016

Hello David and all Flexmonster users,
After the release of version 2.3, we have prepared the updated sample: https://jsfiddle.net/flexmonster/cvkfhr3z/.
Regards,
Tanya

Please login or Register to Submit Answer