Alternative to Format() in iOS?

I am wondering if anyone has developed a function that acts the same was as format() in desktop applications that can be used in iOS? I am trying to figure out a generic method for reducing a number like 12,546 to 12500 as a text value in the same way that format() does.

Then workaround I have found for a single option is:
// double to integer
var initialdose as double = 9834
var initialHeparinDose as int64
initialHeparinDose = round(initialDose/100)*100 // convert double to integer = 9800

It would be. nice to have the full functionality of the desktop format() function available.

my suggestion? dump Xojo for iOS stuff… they left SO many things out it isn’t even funny. Doing what you are asking, in Swift, is a piece of cake…

but that is my opinion, and part of what got me banned from “that other forum”, because I would point out issues…

let initialdose : double = 9834
let initialHeparinDose : String = "\(floor(initialDose/100)*100)"

I am considering getting back to swift for apps, but the challenge of working around the problems with XOJO and the lure of Android is keeping me there for now.
It took me a year to get my first iOS app working in swift. Once I knew the business rules and figured out the way XOJO worked, I was able to redo it in a week.
Your Tip about rejuvenating old swift apps in the current Xcode is very exciting, and I will be using it to update that first app to see how u go with swift after this current Xojo project.

check of this series of posts.

It is not 100% (and this app does only the “business” logic), but it might help you translate some Xojo to Swift