Jump to content
New account registrations are disabed. This website is now an archive. Read more here.

Foxkit

Member
  • Content Count

    182
  • Joined

  • Last visited

  • Days Won

    2

Foxkit last won the day on September 11 2013

Foxkit had the most liked content!

About Foxkit

  • Rank
    Inexperienced Youth
  • Birthday 01/08/1994

Other

  • Referer
    google

Profile Information

  • Gender
    I don't want it to change things between us
  • Location
    I live on a HDD

Contact Methods

  • Skype
    N/A

Engines I Use

  • RPG Maker VX Ace
    No
  • RPG Maker XP
    No
  • Unity
    No
  • RPG Maker MV
    No

Engines

  • Engine Level
    Good
  • Class Title
    Director / Leader
  • Other Skills
    Mythology/ World Building

Single Status Update

See all updates by Foxkit

  1. Question for the Coders: How do you tell ruby to round up or down?

    1. kellessdee

      kellessdee

      you have a few options:

      float.floor

      -rounds to the next integer towards 0, so

      1.5.floor => 1

      (-1.5).floor => -1

      float.ceil

      -rounds to the next integer away from 0, so

      1.5.ceil => 2

      (-1.5).ceil => -2

      float.round

      -just like standard rounding, if >= 0.5 round up, if < 0.5 round down, so

      1.5.round = 2

      1.4.round = 1

      float.truncate

      float.to_i

      -these methods simply chop off the fractional bit, so

      ...

    2. kellessdee

      kellessdee

      1.5.truncate => 1

      1.4.to_i => 1

       

      more info: http://www.ruby-doc.org/core-1.9.3/Float.html

    3. Foxkit

      Foxkit

      Thats exactly what I needed to know :D Thanks Kell

×
×
  • Create New...