|
| 14 Nov 2017 04:27 PM |
??????????????????????????????????????????????????????????????????????????????????????????
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 14 Nov 2017 04:38 PM |
| if str:match("(%.)%w*(%.)") then print("2+ decimals") end |
|
|
| Report Abuse |
|
|
Y0_dude
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 113 |
|
|
| 14 Nov 2017 04:53 PM |
Simpler option:
if number % 0.01 != 1 then print"More than two decimals." end |
|
|
| Report Abuse |
|
|
| |
|
Y0_dude
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 113 |
|
|
| 14 Nov 2017 04:57 PM |
| whoops my mind is all jumbled right now! |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 14 Nov 2017 05:52 PM |
oh i thought he meant like 1.0.1
like 2 decimals |
|
|
| Report Abuse |
|
|
Gryphunk
|
  |
| Joined: 24 Nov 2012 |
| Total Posts: 1267 |
|
|
| 14 Nov 2017 06:20 PM |
local val = 903.22 local sub = string.sub local snum = sub(tostring(val),#tostring(math.floor(val)) + 1) if #snum >= 3 then print("yeet") end
heccled by the master heccler again |
|
|
| Report Abuse |
|
|
|
| 14 Nov 2017 06:30 PM |
local num = 9.999
local chk = tostring(num):find('.') if chk and #tostring(num):sub(chk+1) > 2 then print('More than two decimals in number') end -- Didn't test :| |
|
|
| Report Abuse |
|
|