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.
4 replies to this topic
#1
Posted 07 April 2016 - 04:42 PM
#2
Posted 07 April 2016 - 06: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)).
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)).
#3
Posted 07 April 2016 - 11:51 PM
Moved to Ask a Pro.
#5
Posted 17 April 2016 - 07: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.
As you can see by the cookie crumbs up the top of this page, this thread is currently in Ask a Pro.
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users












