# Scale

The Fixed package stores numbers with a fixed scale (number of decimal places).

If you attempt an operation on two Fixed values with different scales the result will be the larger of the two scales except when doing multiplication.

```dart
final t1 = Fixed.fromInt(12, scale: 1); // == 1.2, scale: 1
final t2 = Fixed.fromInt(2, scale: 2); // == 2.00, scale: 2
final t3 = t1 + t2; // == 2.20, scale: 2

final t3 = t1 * t2; // == 2.40, scale: 3

```

If you multiply two numbers the scale of the result will be the sum of the two scales.

```dart
final t1 = Fixed.fromInt(12, scale: 1); // == 1.2, scale: 1
final t2 = Fixed.fromInt(2, scale: 2); // == 2.00, scale: 2

final t3 = t1 * t2; // == 2.40, scale: 3
```

You can change the scale of a number by creating a new Fixed object using `Fixed.copyWith`.

Example 2

```dart
  final t7 = Fixed.fromNum(1.234, scale: 3); // == 1.234, scale: 3

  /// reduce the scale
  final t8 = Fixed.copyWith(t7, scale: 2); // == 1.23, scale: 2

  /// increase the scale
  final t9 = Fixed.copyWith(t8, scale: 5); // == 1.2300, scale: 5
```


---

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