> 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.md).

# Creating Money

The Money2 package provide a number of methods to create a `Money` instance.

* Money.fromFixed - from a [Fixed](https://pub.dev/packages/fixed) instance.
* Money.fromInt - from a minorUnit (e.g. cents) stored as an int.
* Money.fromBigInt - from a minorUnit stored as a BigInt.
* Money.parse - parse a string containing an amount.
* Money.fromNum - from a num (int or double) - not recommended
* Money.fromDecimal - from a [Decimal](https://pub.dev/packages/decimal)
* Currency.parse - parse a string containing a monetary amount and assumes the currency
* Currencies.parse - parse a monetary string and determine the currency from the&#x20;

  &#x20;  embedded ISO currency code.

The `Money` variants all require you to pass in the `Currency or a currency code (isoCode)`. The `Currency` variant requires only the monetary value. The `Currencies` variant is able to determine  `Currency` if the passed string amount contains a currency code.

The two most common methods are:

* Money.fromFixed
* Currency.parse


---

# 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.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.
