SAP / go-ase

SAP ASE Database Client for Go
Apache License 2.0
25 stars 14 forks source link

Fix String-Representation of type decimal & output of smallmoney #56

Closed frewilhelm closed 4 years ago

frewilhelm commented 4 years ago

Description

  1. Previous string-representation of type-decimal values in the ASE did not show negative decimals, due to *.Abs(dec.i). By using a default value to execute big.NewInt(0).Abs(dec.i) this issue is fixed (Credits to @ntnn).

  2. Negative numbers of ASE-type smallmoney are misrepresented:

    • Inserted value: -999
    • Value displayed: 428497.7296
    • "Explanation": 429496.7295 (maxInt32 without ".") - 999 = 428497.7296

    Thus, the byteslices are misinterpreted, which can be fixed by 'casting' inbetween to int32 (Credits to @ntnn)

How was the patch tested?

Manually compiled and tested by @ntnn and me

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.