better way to do this?

guillefaceguilleface Member, BASIC Posts: 1,039
i need to change a image if attribute is equal to any whole number,1,2,3,4,5,6,7,8,9,10 , or change to another image if attribute is 1.5,2.5,3.5,4.5,5.5,6.5, is there a easy way without having all those number as if any?thanks

Comments

  • ericzingelerericzingeler Member Posts: 334
    Something like this?

    dummyZeroAttribute (index) = 0

    if dummyZeroAttribute = number - ceil(number)

    is whole

    Otherwise

    is fraction
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you'll need someone better in math :)
  • ericzingelerericzingeler Member Posts: 334
    If its just two images you're working with, then you could do this:

    change attribute image to "image"..(ceil(number) - number)

    whole number image name = image0

    fraction image name = image.5
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    @guilleface

    If X = floor(X) then do action.

    Otherwise: do other action.
  • guillefaceguilleface Member, BASIC Posts: 1,039
    thanks guy i will try all of them , sorry i had not log in in some days,
Sign In or Register to comment.