<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/OSLogIntegerFormatting",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os22OSLogIntegerFormattingV"
  },
  "title" : "OSLogIntegerFormatting"
}
-->

# OSLogIntegerFormatting

The formatting options for integer values.

```
@frozen struct OSLogIntegerFormatting
```

## Overview

An [`OSLogIntegerFormatting`](/documentation/os/OSLogIntegerFormatting) structure encapsulates the formatting details for integer numbers. Use the static [`decimal`](/documentation/os/OSLogIntegerFormatting/decimal), [`hex`](/documentation/os/OSLogIntegerFormatting/hex), and [`octal`](/documentation/os/OSLogIntegerFormatting/octal) structures to apply default formatting to integer values. You can also create new [`OSLogIntegerFormatting`](/documentation/os/OSLogIntegerFormatting) structures that customize the rules for handling a leading plus sign, special numerical prefixes, the minimum number of digits, and more.

## Topics

### Getting the Standard Formats

[`decimal`](/documentation/os/OSLogIntegerFormatting/decimal)

The standard decimal format option.

[`hex`](/documentation/os/OSLogIntegerFormatting/hex)

The standard hexadecimal format option.

[`octal`](/documentation/os/OSLogIntegerFormatting/octal)

The standard octal format option.

### Creating a Custom Integer Format

[`decimal(explicitPositiveSign:)`](/documentation/os/OSLogIntegerFormatting/decimal(explicitPositiveSign:))

Creates a decimal format with custom handling of the numerical sign.

[`decimal(explicitPositiveSign:minDigits:)`](/documentation/os/OSLogIntegerFormatting/decimal(explicitPositiveSign:minDigits:))

Creates a decimal format with custom handling of the numerical sign and the minimum number of digits.

[`hex(explicitPositiveSign:includePrefix:uppercase:)`](/documentation/os/OSLogIntegerFormatting/hex(explicitPositiveSign:includePrefix:uppercase:))

Creates a custom hexidecimal format that displays the exact number of digits in the number.

[`hex(explicitPositiveSign:includePrefix:uppercase:minDigits:)`](/documentation/os/OSLogIntegerFormatting/hex(explicitPositiveSign:includePrefix:uppercase:minDigits:))

Creates a custom hexidecimal format that includes a minimum number of digits.

[`octal(explicitPositiveSign:includePrefix:uppercase:)`](/documentation/os/OSLogIntegerFormatting/octal(explicitPositiveSign:includePrefix:uppercase:))

Creates a custom octal format that displays the exact number of digits in the number.

[`octal(explicitPositiveSign:includePrefix:uppercase:minDigits:)`](/documentation/os/OSLogIntegerFormatting/octal(explicitPositiveSign:includePrefix:uppercase:minDigits:))

Creates a custom octal format that includes a minimum number of digits.



---

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)