How to print double without the decimal places in Swift

1 Answer

0 votes
import Foundation
 
let d: Double = 28374092.401;
        
print(String(format: "%.0f", d)) 
 
 
 
/*
run:

28374092

*/

 



answered Nov 12, 2024 by avibootz

Related questions

...