Hi,
I have a textfield that shows a result after some calculation like 4666.6666.
My problem is that I do not need the “.6666” portion of the result and it must not be rounded up to the nearest number like “4667”
How do I go about doing that?

depends what you need
if you need the string just use left(yourstring, (instr(your string, “.”)) or whatever the separator is in your language
if you need the integer use val(your string) for small integers. For larger numbers there is something else, forgotten what it is

Hi,
I actually need the integer.
The calculation came from somewhere else eg. (3500/30) * 4 = 466.6666
How do I format the textfield that receive the result(466.6666) into 466?

Be aware that if you try Floor( -4666.6666) you’ll get -4667. For negative numbers, you’ll have to use the Ceil() function.
To extract the integer part of a number I’m using the following method:

[code]Function zdInt(inValue As Double) As Double

//-- Return the Integer part of inValue

If inValue < 0 Then

// The value is negative we use Ceil()
Return Ceil( inValue )

Else

// the Value is positive ( or zero ), we use Floor()
Return Floor( inValue )

Just as a reminder, using the Integer data type sets a limit depending on the build type ( 32/64 bits ). Doing so with values beyond the limits will lead to unexpected results.
See Integer in Xojo’s doc for the Int32 and Int64 limits and the example demonstrating the value overflow behavior.