<!--
{
  "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/OSLogFloatFormatting",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os20OSLogFloatFormattingV"
  },
  "title" : "OSLogFloatFormatting"
}
-->

# OSLogFloatFormatting

The formatting options for double and floating-point numbers.

```
@frozen struct OSLogFloatFormatting
```

## Overview

An [`OSLogFloatFormatting`](/documentation/os/OSLogFloatFormatting) structure encapsulates the formatting details for `double` and `float` values. Use the static [`fixed`](/documentation/os/OSLogFloatFormatting/fixed), [`hex`](/documentation/os/OSLogFloatFormatting/hex), [`exponential`](/documentation/os/OSLogFloatFormatting/exponential), and [`hybrid`](/documentation/os/OSLogFloatFormatting/hybrid) structures to apply default formatting for floating-point values. You can also create new [`OSLogFloatFormatting`](/documentation/os/OSLogFloatFormatting) structures that customize the rules for handling a leading plus sign, precision information, and more.

## Topics

### Getting the Standard Formats

[`fixed`](/documentation/os/OSLogFloatFormatting/fixed)

The standard fixed-point format option.

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

The standard hexadecimal format for floating-point values.

[`exponential`](/documentation/os/OSLogFloatFormatting/exponential)

The standard exponential format option.

[`hybrid`](/documentation/os/OSLogFloatFormatting/hybrid)

A hybrid option that changes the format according to the size of the number.

### Creating a Custom Formatting Object

[`exponential(explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/exponential(explicitPositiveSign:uppercase:))

Creates a custom exponential format with a system-determined precision value.

[`exponential(precision:explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/exponential(precision:explicitPositiveSign:uppercase:))

Creates a custom exponential format with the specified precision value.

[`fixed(explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/fixed(explicitPositiveSign:uppercase:))

Creates a custom fixed-point format with a system-determined precision value.

[`fixed(precision:explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/fixed(precision:explicitPositiveSign:uppercase:))

Creates a custom fixed-point format with the specified precision value.

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

Creates a custom hexadecimal format.

[`hybrid(explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/hybrid(explicitPositiveSign:uppercase:))

Creates a custom hybrid format with a system-determined precision value.

[`hybrid(precision:explicitPositiveSign:uppercase:)`](/documentation/os/OSLogFloatFormatting/hybrid(precision:explicitPositiveSign:uppercase:))

Creates a custom hybrid format with the precision value.



---

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)