How to use the new FormatStyle to format an Int to hex?

Just a quick note about the big picture here: The new number formatting facilities are conceptually a wrapper around the existing NumberFormatter class. NumberFormatter is focused on localised strings, which is why NumberFormatter.Style has no .hexadecimal value. In contrast, String.init(_:radix::uppercase:) produces a non-localised string. To my mind trying to mix these two seems like a type error.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

8 Likes