javascript - .toLocaleString in Nashorn engine -
i've got test code snippet:
scriptengine engine = new scriptenginemanager().getenginebyname("nashorn"); object o = engine.eval("var = 1000; i.tolocalestring('de-de', { style: 'currency', currency: 'eur' });"); system.out.println(o);
when start test, result :
1000
so, be, nashorn can't execute .tolocalestring()
function? or must work run? i've searched in google, didn't find answer ...
looking @ source code seems doesn't support tolocalestring function. when call function nashorn redirects call on jdk.nashorn.internal.objects.nativenumber.tolocalestring(object)
. method transform input object (that number) in string representation. here code:
public static string tolocalestring(object self) { return jstype.tostring(getnumbervalue(self)); }
this version i've looked at:
c:...\java\bin>jjs -version
nashorn 1.8.0_121
Comments
Post a Comment