[Command] floor

Post Reply
User avatar
Raddeck
LP Manager
Reactions: 1
Posts: 508
Joined: Sat Oct 16, 2021 6:22 pm
Location: LpWorld
Contact:

Post by Raddeck »

{float variable}.floor()


USE:
Use this function to get the integer value of a float variable.
Any value less than x.3 / x.5 / x.8 will be rounded down to "x".


TYPE: Command, Non-Ref (ref-like syntax)
RETURNS: float variable
THEME: Math
COMPARE: round()


EXAMPLE:

Code: Select all

    val = 1.4
    rv = val.round()
    fv = val.floor()
    "Val = <rv>, <fv>"  // Will output 'Val = 1, 1'
    
    val = 1.5
    rv = val.round()
    fv = val.floor()
    "Val = <rv>, <fv>"  // Will output 'Val = 2, 1'
Like my work? Buy me a coffee or support me on Patreon to keep it coming. :ugeek:
-Don't PM me for support-
Top
Post Reply