Fix format float numbers #17

Merged
Enyby merged 1 commits from patch-9 into master 2018-09-16 06:24:05 +00:00
Enyby commented 2018-09-13 23:16:51 +00:00 (Migrated from github.com)

Fix bug: https://sourceforge.net/p/luaj/bugs/53/ if System support String.format or fallback to old way.

Fix bug: https://sourceforge.net/p/luaj/bugs/53/ if System support String.format or fallback to old way.
headcr4sh commented 2018-09-14 10:11:38 +00:00 (Migrated from github.com)

The original bug report on SourceForge contains a simple unit test to verify that formatting of the number works as supposed to. Should we add that unit test?

@Test public void stringFormat() throws ScriptException {
        ScriptEngineManager mgr = new ScriptEngineManager();
        ScriptEngine e = mgr.getEngineByName("luaj");
        e.eval("y = string.format('%.2f', 1.23456)");
        Assert.assertEquals("1.23", (String) e.get("y"));
    }
The original bug report on SourceForge contains a simple unit test to verify that formatting of the number works as supposed to. Should we add that unit test? ```java @Test public void stringFormat() throws ScriptException { ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine e = mgr.getEngineByName("luaj"); e.eval("y = string.format('%.2f', 1.23456)"); Assert.assertEquals("1.23", (String) e.get("y")); } ```
Enyby commented 2018-09-14 11:48:22 +00:00 (Migrated from github.com)

Yes, we can add it. I checked changes manually.

Yes, we can add it. I checked changes manually.
Enyby commented 2018-09-16 03:06:18 +00:00 (Migrated from github.com)

One request - if you are going to make any commits, first approve this pull request, so as not to spoil it, as it was already.

However, I do not see anything that would interfere with the approval of this request, and add tests later, if necessary.

One request - if you are going to make any commits, first approve this pull request, so as not to spoil it, as it was already. However, I do not see anything that would interfere with the approval of this request, and add tests later, if necessary.
headcr4sh (Migrated from github.com) approved these changes 2018-09-16 06:21:06 +00:00
headcr4sh commented 2018-09-16 06:22:52 +00:00 (Migrated from github.com)

Ok.

@Enyby I have given you contributor access to this repo.
So ... Feel free to merge your changes. Just added my approval to the PR.

Ok. @Enyby I have given you contributor access to this repo. So ... Feel free to merge your changes. Just added my approval to the PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#17