# Default format

The Currency class also allows you to specify a default format which is used when parsing or formatting a `Money` instance.

If you are using a Common Currency (recommended) then each has a default format pattern appropriate for that currency.

Note: If no other patterns are specified the default pattern is 'S#,##0.00'

```dart
import 'package:money2/money2.dart';
import 'package:test/test.dart';

void main() {
  test('Default Formatting', () {
    final aud = Currency.create('AUD', 2);
      final costPrice = Money.fromIntWithCurrency(1099, aud);
      expect(costPrice.toString(), equals(r'$10.99'));

      final jpy = Currency.create('JPY', 0, symbol: '¥', pattern: 'S#,##0');
      final yenCostPrice = Money.fromIntWithCurrency(1099, jpy);
      expect(yenCostPrice.toString(), equals('¥1099'));

      final euro = Currency.create('EUR', 2,
          symbol: '€',
          decimalSeparator: ',',
          groupSeparator: '.',
          // The pattern MUST use the default group and decimal separators.
          // This allows us to share patterns across currencies.
          pattern: 'S#,##0.00');
      final euroCostPrice = Money.fromIntWithCurrency(899, euro);
      expect(euroCostPrice.toString(), equals('€8,99'));

      final euroValue = euro.parse('€2,99');
      expect(euroValue.toString(), equals('€2,99'));
  });
}

```

You can also use the `Money.format` method to define a specific format where required. See details below


---

# Agent Instructions: 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/default-format.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.
