View Issue Details

IDProjectCategoryView StatusLast Update
0009869New Feature Requests[All Projects] Generalpublic2018-06-18 20:37
ReporterMrDadoszAssigned To 
PrioritylowSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Summary0009869: tointeger function
Description

There is tointeger function built in Lua, but MTA:SA is using older Lua version. I know that I can write this function, but it should be in MTA because it's easy to implement. Should return nil if number can't be converted to a integer (0.5, "asd" etc.) or returns float (12, "10" etc,)

TagsNo tags attached.

Activities

codylewiz

2018-05-19 21:25

viewer   ~~0026530

function isinteger(number)
return number == math.floor(number)
end

CrosRoad95

2018-05-19 21:26

reporter   ~~0026531

I think, mta staff should take a look at new functions in lua and add them to mta.

thisdp

2018-05-27 04:47

viewer   ~~0026539

if number%1 == number then
end

this is faster than any method

thisdp

2018-05-27 05:10

viewer   ~~0026540

ah, its number%1 == 0
and actually he is not talking about this thing

Issue History

Date Modified Username Field Change