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

Product Line

TAC Vista

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;
}