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

# Money.parse

Money.parse parses a string containing a monetary value.

`Money.fromInt` is faster if you already have the value represented as an integer in minor units.

The simplest variant of `Money.parse` relies on the default `pattern` of the passed currency.

```dart
import 'package:money2/money2.dart';   
test('Money.parse', () {
      final usd = Currency.create('USD', 2);
      final amount = Money.parseWithCurrency(r'$10.25', usd);
      expect(amount.currency.isoCode, equals('USD'));
    });
```

You can also pass an explicit pattern.

```dart
import 'money2.dart';
   test('Money.parse with Pattern', () {
      final usd = Currency.create('USD', 2);
      final amount = Money.parseWithCurrency(r'$10.25', usd, pattern: 'S0.00');
      expect(amount.currency.isoCode, equals('USD'));
    });
```
