This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
gril002's profile picture

The ".0" bug in the fs API

Started by gril002, 07 April 2016 - 03:42 PM
gril002 #1
Posted 07 April 2016 - 05:42 PM
When you write a number with fs.writeLine("10") it will sometimes be written as 10.0 for some reaseon.I know this is an old bug but it can be really annoying and can sometimes cause programs to not work correctly.
Bomb Bloke #2
Posted 07 April 2016 - 07:29 PM
There's a difference between fs.writeLine("10") and fs.writeLine(10).

As a general rule, if you're relying on ComputerCraft to convert a number to a string for you, it'll include the first decimal place (even if it's a zero). If you don't want that, then tostring() will format it out for you - eg fs.writeLine(tostring(10)).
Lyqyd #3
Posted 08 April 2016 - 12:51 AM
Moved to Ask a Pro.
LoganDark #4
Posted 17 April 2016 - 06:31 AM
Moved to Ask a Pro.
Liar

EDIT: The post shows in Bugs (with 0 views), not sure if it was actually moved or not.
Edited on 17 April 2016 - 04:31 AM
Bomb Bloke #5
Posted 17 April 2016 - 08:58 AM
When we move topics, we typically opt to leave behind a redirect link leading to their new location. These are identified with a mine cart icon.

As you can see by the cookie crumbs up the top of this page, this thread is currently in Ask a Pro.