Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

ruby gotcha

out = filename.dup
out << " %.2f%%" % 100 * fraction_complete
puts out


For some inputs, this prints 100.00%, but for others it doesn't print any percentage at all -- why?

Answer follows in the comments.
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 9 comments