<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCell/setFloatingPointFormat:left:right:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCell(im)setFloatingPointFormat:left:right:"
  },
  "title" : "setFloatingPointFormat:left:right:"
}
-->

# setFloatingPointFormat:left:right:

Sets the auto-ranging and floating point number format of the receiver’s cell.

```
- (void) setFloatingPointFormat:(BOOL) autoRange left:(NSUInteger) leftDigits right:(NSUInteger) rightDigits;
```

## Parameters

`autoRange`

If <doc://com.apple.documentation/documentation/Swift/true>, auto-ranging is enabled, otherwise it is disabled.

`leftDigits`

The number of digits to display to the left of the decimal point.

`rightDigits`

The number of digits to display to the right of the decimal point.

## Discussion

Sets whether floating-point numbers are auto-ranged in the receiver and sets the sizes of the fields to the left and right of the decimal point. If `autoRange` is <doc://com.apple.documentation/documentation/Swift/false>, `leftDigits` specifies the maximum number of digits to the left of the decimal point, and `rightDigits` specifies the number of digits to the right (the fractional digit places will be padded with zeros to fill this width). However, if a number is too large to fit its integer part in `leftDigits` digits, as many places as are needed on the left are effectively removed from `rightDigits` when the number is displayed.

If `autoRange` is <doc://com.apple.documentation/documentation/Swift/true>, `leftDigits` and `rightDigits` are simply added to form a maximum total field width for the receiver (plus 1 for the decimal point). The fractional part will be padded with zeros on the right to fill this width, or truncated as much as possible (up to removing the decimal point and displaying the number as an integer). The integer portion of a number is never truncated—that is, it is displayed in full no matter what the field width limit is.

The following example sets a cell used to display dollar amounts up to 99,999.99:

```objc
    [[currencyDollarsField cell] setEntryType:NSFloatType];
    [[currencyDollarsField cell] setFloatingPointFormat:NO left:5  right:2];
```

---

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)