Can we use either of these?

function toInteger(number)  
 return math.floor(number)  
toInteger = math.floor  

trying to convert an incoming float (0.001 to 1) to an integer and this is what I have found so far.

This is what I got so far, it looks like I need some kind of checking somewhere i think:

add_global_action {  
pattern = "/sample/loop_end",  
description = "float",  
arguments = { argument("loop_end", "number") },  
handler = function(loop_end)  
local sample =;  
local numberFrames = sample.sample_buffer.number_of_frames;  
local minY = 1;  
local max = numberFrames;  
local maxY = math.ceil(max)  
sample.loop_end = clamp_value(loop_end, minY, maxY)  

The way I have it, it looks like I need something more for both minY & maxY to understand I want to give it a float.
Taking numberFrames that uses integers to use or accept a float from the viewbuilder’s xypad.
From what I can tell from other’s work I need to be using if, then & else to do some checking.
I should be getting my beginning lua book in the mail sometime this week or next so I should be able to begin understanding these orbiting concepts.