Type Safely

Type Safely

Share this post

Type Safely
Type Safely
A SwiftUI Property Wrapper To Specify Decimal Places For Floating-Point Numbers

A SwiftUI Property Wrapper To Specify Decimal Places For Floating-Point Numbers

Daily Coding Tip 033

Type Safely's avatar
Type Safely
Jan 20, 2021
∙ Paid

Share this post

Type Safely
Type Safely
A SwiftUI Property Wrapper To Specify Decimal Places For Floating-Point Numbers
Share
Image by max_gloin on Pixabay

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.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share