# How to store numbers greater than 2^64

**URL:** <https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737>\
**Category:** Sway\
**Created:** [December 15, 2022, 1:42am UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737 "2022-12-15T01:42:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 15, 2022, 1:42am UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737/1 "2022-12-15T01:42:25Z")

</div>

Hi there! In continuation of [“how to save strings in the storage of DApp topic”](https://forum.fuel.network/t/how-to-save-strings-in-storage-of-dapp/735) I thought about decimals. For example, I want to issue the ETH token with decimals 18, but the maximum number type in sway is `u64` and that means I can use numbers till `2^18 = ~18.4467 * 1e18`.  
Is it possible to somehow use a larger type, or maybe it will be possible to store a large number as a string?

---

<div class="post-metadata">

**Author:** ![furnic](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@furnic](https://forum.fuel.network/u/furnic)\
**Post date:** [December 15, 2022, 3:55am UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737/2 "2022-12-15T03:55:00Z")

</div>

If you need really large numbers, the sway standard library has both `U128` and `U256` types available.

> <https://github.com/FuelLabs/sway/blob/50c1b6c858c044acf88760cb7eb1b39d076f322d/sway-lib-std/src/u256.sw#L26>

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 15, 2022, 9:48am UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737/3 "2022-12-15T09:48:51Z")

</div>

Thanks, will try to use `U128` and `U256` 🫡

---

<div class="post-metadata">

**Author:** ![Fuelgasoline](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuelgasoline/32/452_2.png) [@Fuelgasoline](https://forum.fuel.network/u/Fuelgasoline)\
**Post date:** [December 15, 2022, 12:58pm UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737/4 "2022-12-15T12:58:07Z")

</div>

Thank for the question. I got it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [January 5, 2023, 8:59am UTC](https://forum.fuel.network/t/how-to-store-numbers-greater-than-2-64/737/5 "2023-01-05T08:59:01Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
