# Nat.fromText doesn't exist

**URL:** <https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793>\
**Category:** Developers\
**Tags:** Functional-Programming, release\
**Created:** [March 3, 2023, 5:34am UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793 "2023-03-03T05:34:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 3, 2023, 5:34am UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/1 "2023-03-03T05:34:56Z")

</div>

Try to use Nat.fromText, but got error as below snapshot, anyone has idea about it? I am using the latest dfx 0.13.1

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/8/875be3ccde356c346ac2d87815c4edf1f5a6f172.png)

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [March 3, 2023, 7:53am UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/2 "2023-03-03T07:53:20Z")

</div>

Ah, sorry, we need to update the moc\_js interpreter used on doc web site, I think.

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 3, 2023, 1:13pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/3 "2023-03-03T13:13:21Z")

</div>

Thanks, same as I use it in local env

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [March 3, 2023, 2:20pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/4 "2023-03-03T14:20:30Z")

</div>

Ok, so the problem is that the doc web site is describing version 0.8.3 (because someone updated it by mistake), but the interpreter used for the examples wasn’t updated and is still on 0.7.6.

And the most recent version of dfx only ships with moc 0.7.6.

The `fromText` function doesn’t actually exist in 0.7.6.

We’ve fixed the interpeter on the web site, but that won’t help you with dfx.

Although there documentation is now too fresh, we thought that might still be better since it now include many examples that weren’t in the 0.7.6 documentation. Hopefully dfx will ship with moc 0.8.3 reasonably soon.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [March 3, 2023, 2:34pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/5 "2023-03-03T14:34:45Z")

</div>

If you want to use the latest Motoko version, have a look [over here](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665) for instructions

---

<div class="post-metadata">

**Author:** ![rossberg](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rossberg/32/795_2.png) [@rossberg](https://forum.dfinity.org/u/rossberg)\
**Post date:** [March 3, 2023, 2:36pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/6 "2023-03-03T14:36:11Z")

</div>

Why isn’t a new release of dfx always including the most recent Motoko by default? As a user, I would probably be so naive to expect that.

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [March 3, 2023, 2:41pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/7 "2023-03-03T14:41:54Z")

</div>

dfx ships like once a month. We release more often. And we delayed the release of 0.8.x because of worries about introducing breaking changes during the SNS launch.

---

<div class="post-metadata">

**Author:** ![sas4n](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sas4n/32/15930_2.png) [@sas4n](https://forum.dfinity.org/u/sas4n)\
**Post date:** [March 2, 2024, 2:16pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/8 "2024-03-02T14:16:03Z")

</div>

I’m wondering if this problem still exists, since I’m getting the same error when I want to use Nat.fromText().

---

<div class="post-metadata">

**Author:** ![h1teshtr1path1](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/h1teshtr1path1/32/24662_2.png) [@h1teshtr1path1](https://forum.dfinity.org/u/h1teshtr1path1)\
**Post date:** [March 3, 2024, 1:58pm UTC](https://forum.dfinity.org/t/nat-fromtext-doesnt-exist/18793/9 "2024-03-03T13:58:02Z")

</div>

Well there is no official implementation yet i guess. But you can use this : [game-launcher/src/game\_launcher\_backend/utils/Helpers.mo at 483ce08caebeedb116f5fe94c88d9e1bd755cee4 · BoomDAO/game-launcher · GitHub](https://github.com/BoomDAO/game-launcher/blob/483ce08caebeedb116f5fe94c88d9e1bd755cee4/src/game_launcher_backend/utils/Helpers.mo#L59)
