playMaker

Author Topic: Round  (Read 2422 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Round
« on: January 24, 2015, 01:01:15 AM »
I'd like to see a rounder.  So you have a number (int or float) and you want to round it.  geez, now you have to do compares and all.  It'd be neat to be able to put the variable in and decide the rounding.

So I have a float called 'number'.  It is between 0 and 1 for music sound.  There is a clamp so it never goes higher or lower than 0 or 1.  When using a mouse, you can drag it and get detailed numbers but when using a joystick, I increment by 5%.  So what happens if it was 9%?  Then incrementing to 14%.  I'd rather it be 10 or 15.  So the 'number' when rounded to the nearest '5' would make it 10.

Fairly easy to do but I have no idea how to make actions myself.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Round
« Reply #1 on: January 25, 2015, 09:31:06 AM »
float round exits already search float round on the EcoSystem

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Round
« Reply #2 on: January 26, 2015, 10:40:53 AM »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D