.toLocaleString in Nashorn engine

Viewed 312

I've got this test code snippet:

ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
Object o = engine.eval("var i = 1000; i.toLocaleString('de-DE', { style: 'currency', currency: 'EUR' });");
System.out.println(o); 

When I start the test, I get this result :

1000

So, could it be, that Nashorn can't execute the .toLocaleString() function? Or must I do some extra work to get it run? I've searched in google, but didn't find an answer ...

1 Answers
Related