webForumDet fria alternativet

Vad gör Int?

ASP

2 svar · 177 visningar · startad av nybörjare

Medlem sedan nov. 200178 inlägg
Frågan#1

Hejsan.

Ja som rubriken, vad gör Int??? har sett det i olika scripts men jag kan inte hitta vad det gör t.ex såg denna koden för ett tag sedan...

ElseIf (Int(tv2)) = (Int(tv)) then

Medlem sedan mars 2002777 inlägg
#2

Från documentationen:

Description
Returns the integer portion of a number.
Syntax
Int(number)
Fix(number)

The number argument can be any valid numeric expression. If number contains Null, Null is returned.

Remarks
Both Int and Fix remove the fractional part of number and return the resulting integer value.
The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.

Fix(number) is equivalent to:

Sgn(number) * Int(Abs(number))

Medlem sedan mars 20015 287 inlägg
246 ms totalt · 4 externa anrop · v20260731065814-full.86ec41c2
122 ms — deklarationer (db)
0 ms — hämta statistik (cache)
121 ms — hämta tråd, inlägg och bilagor (db)
119 ms — ändringar (db)