Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

how do i get a string from a float swift to 1 decimal swift

let someFloat: Float = 3.14159
let floatToString: String = String(format: "%.01f", someFloat)
// floatToString => 3.14
 
PREVIOUS NEXT
Tagged: #string #float #swift #decimal #swift
ADD COMMENT
Topic
Name
4+4 =