# How to re-create a Decimal with a string originally from Decimal.description (must be locale independent)?

**URL:** <https://forums.swift.org/t/how-to-re-create-a-decimal-with-a-string-originally-from-decimal-description-must-be-locale-independent/53871>\
**Category:** Using Swift\
**Created:** [December 6, 2021, 5:13pm UTC](https://forums.swift.org/t/how-to-re-create-a-decimal-with-a-string-originally-from-decimal-description-must-be-locale-independent/53871 "2021-12-06T17:13:20Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Jens](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jens/32/12903_2.png) [@Jens](https://forums.swift.org/u/Jens)\
**Post date:** [December 11, 2021, 8:04pm UTC](https://forums.swift.org/t/how-to-re-create-a-decimal-with-a-string-originally-from-decimal-description-must-be-locale-independent/53871/17 "2021-12-11T20:04:31Z")

</div>

Except you will suffer from the [going-via-Double-issue](https://forums.swift.org/t/how-to-initialize-decimal/53630/21) when using JSONEncoder/JSONDecoder:

```swift
let d = Decimal(rawValue: "3.133")!
print(d) // 3.132999999999999488

```

---

_[View the full topic](https://forums.swift.org/t/how-to-re-create-a-decimal-with-a-string-originally-from-decimal-description-must-be-locale-independent/53871)._
