> For the complete documentation index, see [llms.txt](https://money2.onepub.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://money2.onepub.dev/creating-money/money.fromint.md).

# Money.from

`The Money class allows you to create a Money instance from a variety of other types:`

* Money.fromFixed
* Money.fromInt
* Money.fromBigInt
* Money.fromNum
* Money.fromDecimal

Each of the variants have a `withCurrency` alternate form:

* Money.fromFixedWithCurrency
* Money.fromIntWithCurrency
* Money.fromBigIntWithCurrency
* Money.fromNumWithCurrency
* Money.fromDecimalWithCurrency

The recommended method is  to used ``Money.fromFixed or the `withCurrency` alternative. Using `fromFixed` then allows you to store and transmit your Money amounts without loss of precision.``

`Money` can be instantiated by providing the amount in the minor units of the currency (e.g. cents):

```dart
 test('parse with Currency', () {
        // create one (1) australian dollar
        Money.fromFixed(Fixed.fromInt(100), isoCode: 'AUD');

        Money.parse(r'$1.00', isoCode: 'AUD');

        Money.fromFixedWithCurrency(Fixed.fromInt(100), CommonCurrencies().aud);

        Money.parseWithCurrency(r'$1.00', CommonCurrencies().aud);

        /// Create a money value of $5.10 usd from an int
        Money.fromInt(510, isoCode: 'USD');

        /// Create a money value of ¥25010 from a big int.
        Money.fromBigInt(BigInt.from(25010), isoCode: 'JPY');
      });
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://money2.onepub.dev/creating-money/money.fromint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
