Interpolating and integer

I tried interpolate with an integer attribute and using "display text" I observed the increase was with decimals which is kind of strange since integers aren't supposed to have decimals.
Is there a way I can use the interpolate behavior to increase the value of an attribute without going through the decimals
Meaning increasing by 1
(I'm trying to avoid timers)

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    In your Display Text use the Floor Function. So if your Attribute was called Number you would:

    Display Text: Floor(Number)

    Then you will only see integers display.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2017

    @abuabed84 said:
    I tried interpolate with an integer attribute and using "display text" I observed the increase was with decimals which is kind of strange since integers aren't supposed to have decimals.

    Integers, real numbers, index numbers (and so on) are descriptions of the 'boxes' in which values are stored - once a number is out of its 'box' it doesn't know that it's meant to be an Integer or a 'real', it's simply a number.

    Or to put it another way, there aren't two different 7's in maths, an integer 7 and a real 7, for example if you have a real attribute with a value of 7 and an integer with a value of 7 and you add these two values together (for example in a display text behaviour / display attribute A + attribute B ) then you will get 14, but that 14 is not a weird sort of 14 with a mix of real and integer numbers, it's simply 14.

    tl;dr: integer/real (etc) describes the process of storing values, not the values themselves.

Sign In or Register to comment.