Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hi,
My need is to have decimal values like it are in the database without any alteration due to the approximation.
For example :
In a database number field, I could have :
249,199999999998
249,19999999998
249,1999999998
When i try to retrieved it from the database, i get in JS number
249.19999999999803
249.19999999998
249.19999999979999
Well, the result is not safe.
The most safe solution is to retrieve it as string.
So, I introduced setNumberStringFormat option for the connection object . You can set format for decimal number as "99999999999999.99999999999999" for example.
cnx.setNumberStringFormat( "99999999999999.99999999999999" );
When it is set, number value are retrieved as string without alteration :
249,19999999999800
249,19999999998000
249,19999999980000
That's allow me to transform these string values in my own javascript BCD format.
I splited integer type (Integer/smallint) from the other number types, but, it's not usefull because oracle create smallint and integer as number(38) type.
It's possible to switch off the option by assigning an empty string in format.
cnx.setNumberStringFormat("");
Thanks to watch my request