views:

47

answers:

2

Hi there,

Lets say i have this number: 1.5676556 But i want it to show only 1 (without rounding, lets say i have 0.6, if i use math.round, it will round it to 1)

tnx in advanced.

+5  A: 

Use Math.floor(0.6), or if you really want to use string manipulation, String(0.6).split('.')[0].

nikc
thanks, works. :)
WEBProject
glad to be of assistance :-)
nikc
+1  A: 

You are looking for Math.floor if the number greater than 0.

Emrah GOZCU