PP.TS.isTruncateSerie

Syntax

PP.TS.isTruncateSerie (serie);

Parameters

serie. Sets series index.

Description

The isTruncateSerie method determines whether specified series is calculated using the Truncate formula.

Comments

This method returns True if formula type of the series passed to the method as a parameter, is Truncate, otherwise the method returns False.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and the following code must be added in the document opening event handler:

var getIsTruncateSerieButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Get Series Type", //Text
	Click: PP.Delegate(onClickType)     
}); 
function onClickType()
	{
		var series = wbk.getSeries();
		var messageString = "";
		for (var i = 0; i<series.length; i++)
			{
				//Determine whether the specified series is calculated by the Truncate formula
				PP.TS.isTruncateSerie(series[i]) ? addTruncateSerieString(i) : addTruncateModSerieString(i);
			}
		function addTruncateSerieString(rowIndex)
			{
				messageString = messageString + "The series number " + i + " - has the Truncate formula type" + '\n';
			}
		function addTruncateModSerieString(rowIndex)
			{
				messageString = messageString + "The series number " + i + " -  has a formula type that differs from the Truncate type" + '\n';
			}
		alert(messageString);
	}

After executing the example the button named Get Series Type is placed in HTML page. Clicking this button shows a message on whether the series available in the table are calculated using the Truncation formula.

See also:

PP.TS