62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 31 Aug 2015 11:52 AM |
NumberValue's Value: 1.10000000000005 or etc..
How would I make this text's appear as that value but only this part:
Damage: 1.1
Not
Damage: 1.000000000005
Or
Damage: 1 (Using math.floor would do this)
|
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
| |
|
|
| 31 Aug 2015 12:09 PM |
| What do you mean? math.floor |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 31 Aug 2015 12:10 PM |
Oh, maybe math.floor does work. :P
Sorry ;3. |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2015 12:15 PM |
| TruncDamage = math.floor(Damage * 10) /10 |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 01 Sep 2015 10:31 AM |
| Thanks BJ, but it didn't actually turn out to be a problem. The extra numbers after the first two (1.10000000000000) don't show up on the text. I guess cause they're zeros. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Sep 2015 10:44 AM |
Also nicely you can do this
string.format("%.1f",DAMAGE)
and it will give you back a string form of the damage with 1 decimal place. It also rounds for you. |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
| |
|