<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSDecimalNumberBehaviors/scale()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSDecimalNumberBehaviors(im)scale"
  },
  "title" : "scale()"
}
-->

# scale()

Returns the number of digits allowed after the decimal separator.

```
func scale() -> Int16
```

## Return Value

The number of digits allowed after the decimal separator.

## Discussion

This method limits the precision of the values returned by `NSDecimalNumber`’s `decimalNumberBy...` methods. If [`scale()`](/documentation/Foundation/NSDecimalNumberBehaviors/scale()) returns a negative value, it affects the digits before the decimal separator as well. If [`scale()`](/documentation/Foundation/NSDecimalNumberBehaviors/scale()) returns `NSDecimalNoScale`, the number of digits is unlimited.

Assuming that [`roundingMode()`](/documentation/Foundation/NSDecimalNumberBehaviors/roundingMode()) returns `NSRoundPlain`, different values of [`scale()`](/documentation/Foundation/NSDecimalNumberBehaviors/scale()) have the following effects on the number 123.456:

|Scale             |Return Value|
|------------------|------------|
|`NSDecimalNoScale`|123.456     |
|2                 |123.45      |
|0                 |123         |
|–2                |100         |

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)