Knowledge Base
cancel
Showing results for 
Search instead for 
Did you mean: 

Get "Type error: cannot call method "toFixed" of null" error message when opening a TGML graphic, upgraded to Vista 5.1.7

Issue

Get "Type error: cannot call method "toFixed" of null" error message when opening a TGML graphic, upgraded to Vista 5.1.7

 

A TGML script has stopped working after upgrading to Vista 5.1.7

Environment

TAC Vista Workstation 5.1.7

TGML editor 5.1.7 219

Cause

Javascript method toFixed can only be used with numerical values. The TGML engine in TGML 5.1.7 is stricter than the older versions, so an upgraded script may have worked in previous versions.

Resolution

An example when using convertCustom element.

Original script:

function convert(value)
{
value = value.toFixed(2);

return value;
}


should be:

function convert(value)
{
value = Number(value).toFixed(2);

return value;
}
 

Tags (1)
Labels (1)
Version history
Revision #:
1 of 1
Last update:
‎2018-09-06 12:55 PM
Updated by: