Fix negative values smaller than zero
This commit is contained in:
		| @@ -120,6 +120,9 @@ func (n Numeric) MarshalJSON() ([]byte, error) { | |||||||
|  |  | ||||||
| 	split := length - exp | 	split := length - exp | ||||||
| 	bytesWithSeparator = append(bytesWithSeparator, bytes[:split]...) | 	bytesWithSeparator = append(bytesWithSeparator, bytes[:split]...) | ||||||
|  | 	if split == 1 && n.Int.Int64() < 0 { | ||||||
|  | 		bytesWithSeparator = append(bytesWithSeparator, byte('0')) | ||||||
|  | 	} | ||||||
| 	bytesWithSeparator = append(bytesWithSeparator, byte('.')) | 	bytesWithSeparator = append(bytesWithSeparator, byte('.')) | ||||||
| 	bytesWithSeparator = append(bytesWithSeparator, bytes[split:]...) | 	bytesWithSeparator = append(bytesWithSeparator, bytes[split:]...) | ||||||
| 	return bytesWithSeparator, nil | 	return bytesWithSeparator, nil | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user