Jump to content




The ".0" bug in the fs API



  • You cannot reply to this topic
4 replies to this topic

#1 gril002

  • Members
  • 38 posts

Posted 07 April 2016 - 04: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.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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)).

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 April 2016 - 11:51 PM

Moved to Ask a Pro.

#4 LoganDark

  • Members
  • 231 posts
  • LocationMacintosh HD/Users/LoganDark

Posted 17 April 2016 - 05:31 AM

View PostLyqyd, on 07 April 2016 - 11:51 PM, said:

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 by LoganDark, 17 April 2016 - 05:31 AM.


#5 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users