How do I figure out what number is the highest?

My script is like this how do I figure out the highest number of the bunch?

set NumberNumber to "34543"
get characters of NumberNumber

try this one:

set NumberNumber to "34543"

maxInList(characters of NumberNumber)

on maxInList(theList)
	copy item 1 of theList to maxvalue
	repeat with x in theList
		if x > maxvalue then copy contents of x to maxvalue
	end repeat
	return maxvalue
end maxInList

Greets from