Skip to content

Commit

Permalink
Merge branch 'master' into dehesa-master
Browse files Browse the repository at this point in the history
# Conflicts:
#	sources/declarative/encodable/containers/SingleValueEncodingContainer.swift
  • Loading branch information
nghialuong committed Sep 6, 2024
2 parents 99ace2c + 1cb90c0 commit beb6252
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ extension ShadowEncoder.SingleValueContainer {
mutating func encode(_ value: Decimal) throws {
switch self._encoder.sink._withUnsafeGuaranteedRef({ $0.configuration.decimalStrategy }) {
case .locale(let locale):
var number = value
let string = NSDecimalString(&number, locale)
let nf = NumberFormatter()
nf.numberStyle = .decimal
nf.locale = locale
let string = nf.string(from: NSDecimalNumber(decimal: value))
try self.encode(string)
case .custom(let closure):
try closure(value, self._encoder)
Expand Down

0 comments on commit beb6252

Please sign in to comment.