Share via


SP.ScriptUtility.truncateToInt(n) Method

Applies to: SharePoint Foundation 2010

In this article
Return Value
Remarks
Applies To

Gets the largest integer value that is less than or equal to the specified number if the number is greater than 0. Otherwise, gets the smallest integer value that is greater than or equal to the number.

var value = SP.ScriptUtility.truncateToInt(n);

Parameters

n

Type: Double

The number to truncate.

Return Value

Type: Int32

The largest integer value that is less than or equal to the specified number if the number is greater than 0; otherwise, the smallest integer value that is greater than or equal to the number.

Remarks

This method gets the greatest integer less than or equal to the number specified by the n parameter if the number is bigger than 0. Otherwise gets the smallest integer greater than or equal to the number.

Applies To

SP.ScriptUtility Class

See Also

Reference

SP.ScriptUtility Fields

SP.ScriptUtility Methods

SP Namespace