I have:-
var numb = 1234.5678;
var frmt = numb.toLocaleString('de-DE', { style: 'currency', currency: 'EUR',minimumFractionDigits: 2, maximumFractionDigits: 2});
I expect frmt to be 1.234,57 €
But frmt is "1234.5678" - just a string version of the float. Does TC support toLocaleString?
From the help (found at https://support.smartbear.com/testcomplete/docs/scripting/specifics/javascript.html )
JavaScript in TestComplete does not support the ECMAScript Internationalization API.
toLocaleString is part of that Internationalization API... therefore, not supported.
If you need to convert to a currency, you can use aqConvert.CurrencyToStr... I know that it's a number, but because this is not a strongly typed language, you can still pass your number to that converstion routine and it will convert it to a string formatted as a currency... you can also use aqConvert.CurrencyToFormatStr... now, it will still use your default location in your environment to determine the separators and such... To that end, you'll need to have the Locale set using SetLocaleInfo.
Subject | Author | Latest Post |
---|---|---|