chore: decimal padding - #1618
Draft
BobdenOs wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
decimal test
The goal of this PR is to identify how others handle
Decimalcolumns.The conclusion is that the current behavior of padding
Decimalcolumns to their definedscaleis the standard.All databases pad their
decimalnumbers. EvenSQLite3does as1.0could have been1. It is important to keep in mind thatSQLite3doesn't have ascalesetting for theirrealdata type. There for thescaleof arealis still showing in the string result as>0. Where anintegerhas in implicitscaleof0.HANA
hana-client [ { DECIMAL: '1.0000', STRING: '1.0000' }, { DECIMAL: '0.1000', STRING: '0.1000' }, { DECIMAL: '9.0000', STRING: '9.0000' } ] hdb [ { DECIMAL: '1.0000', STRING: '1.0000' }, { DECIMAL: '0.1000', STRING: '0.1000' }, { DECIMAL: '9.0000', STRING: '9.0000' } ]Postgres
pg [ { decimal: '1.0000', string: '1.0000' }, { decimal: '0.1000', string: '0.1000' }, { decimal: '9.0000', string: '9.0000' } ]SQLite3
in SQLite3
realdoesn't have ascalenode:sqlite [ [Object: null prototype] { decimal: 1, string: '1.0' }, [Object: null prototype] { decimal: 0.1, string: '0.1' }, [Object: null prototype] { decimal: 9, string: '9.0' } ] better-sqlite3 [ { decimal: 1, string: '1.0' }, { decimal: 0.1, string: '0.1' }, { decimal: 9, string: '9.0' } ] sql.js [ { decimal: 1, string: '1.0' }, { decimal: 0.1, string: '0.1' }, { decimal: 9, string: '9.0' } ]CAP java