# Overview

The Fixed package allows you to store and perform math on decimal numbers with a fixed scale (fixed no. of decimal places).

All amounts are stored as BigInts to allow precision math to be performed.

## Sponsored by OnePub

Help support Fixed by supporting [OnePub](https://onepub.dev/drive/0b899961-c78e-4f80-9d94-cfbce54832fa), the private dart repository.

OnePub allows you to privately share Dart packages across your Team and with your customers.

Try it for free and publish your first private package in seconds.

| ![](https://269321363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWuLOAzBD2JrEpcOB3Aq9%2Fuploads%2FHbpyHPcH940nECAUt6t5%2FOnePub.dev%20Logo%20%E2%80%93%20gitbook%20sponsored%20by.svg?alt=media\&token=78b9c68b-6c00-4cee-b0d7-3ccf8f12fc6d) | <p>Publish a private package in five commands:</p><p><mark style="color:green;"><code>dart pub global activate onepub</code></mark></p><p><mark style="color:green;"><code>onepub login</code></mark></p><p><mark style="color:green;"><code>cd \<my package></code></mark></p><p><mark style="color:green;"><code>onepub pub private</code></mark> </p><p><mark style="color:green;"><code>dart pub publish</code></mark></p> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

### Features

The features of Fixed are:

* Fixed uses a selectable fixed scale (no. of decimal places)
* Fixed provides a builtin formatter and parser `Fixed.format(pattern)`
* Fixed includes a convenience method `Fixed.formatIntl(locale)` which formats the number with the provided locale or the default locale if not provided.
* You can create a Fixed instance from a number sources

```dart
var t1 = Fixed.fromNum(1); /// == 1.00
var t2 = Fixed.fromNum(1, scale: 3); /// == 1.000

var add = t1 + 10;
var multiply = t1 * t2;

var t3 = Fixed.parse("1.23356"); // == 1.23356, scale: 5

if (t1 == t2) // true
{
    print(t1.format('0.##')); // '1.00'
}

```


---

# 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://fixed.onepub.dev/overview.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.
