We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6004b64 commit 523f89fCopy full SHA for 523f89f
Sources/PostgreSQL/Data/PostgreSQLData+String.swift
@@ -48,9 +48,13 @@ extension String: PostgreSQLDataConvertible {
48
49
/// depending on our offset, append the string to before or after the decimal point
50
if offset < metadata.weight.bigEndian + 1 {
51
- integer += offset == 0 ? string : String(repeating: "0", count: 4 - string.count) + string
+ // insert zeros (skip leading)
52
+ if offset > 0 {
53
+ integer += String(repeating: "0", count: 4 - string.count)
54
+ }
55
+ integer += string
56
} else {
- // Leading zeros matter with fractional
57
+ // leading zeros matter with fractional
58
fractional += String(repeating: "0", count: 4 - string.count) + string
59
}
60
0 commit comments