Formatted float output

Ethelred

Member
I seem to remember that a capabilty was added to control how many digits get printed to the right of the decimal point when printing floating point numbers. But my search fu seems very weak today and I can't find anything in these forums or on the KoLmafia wiki about that. Can anybody help me out with a link or tell me I'm just imagining stuff?

Thanks.
 

slyz

Developer
I don't remember this as part of Mafia. There is a Zlib function for this, though:
PHP:
string rnum(float n, int place)
 

Ethelred

Member
Thanks, roippi. That was exactly what I was looking for. I failed to remember that it involved "to_string()" which is probably why I couldn't find it. And yes, it would be great if that could be added to the wiki.
 

Catch-22

Active member
You mean the wiki that anyone can register for and make page edits? Yeah someone should get on that.

*throws slipper at Bale*
 

Ethelred

Member
You mean the wiki that anyone can register for and make page edits? Yeah someone should get on that.

*throws slipper at Bale*

Yeah, that's exactly the one I mean. And just because anyone can get the permission to do it doesn't mean they have the knowledge to do it.
 
Top