A SwiftUI Property Wrapper To Specify Decimal Places For Floating-Point Numbers
Daily Coding Tip 033

Like yesterday this tip is a property wrapper, but what it does is a bit more simple. It will round to the number of decimal places you specify, which is helpful for situations where you want to display the value of a floating-point number in SwiftUI. You’ll notice that this property wrapper takes a generic type that conform…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.