Skip to content

Commit

Permalink
v0.0.37
Browse files Browse the repository at this point in the history
critical rounding bug fix
  • Loading branch information
staniska committed Jul 1, 2021
1 parent b165821 commit 783e9e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@
- FOR-ENDFOR with named variable
- calculation of RP perfomed in WCS
- calculation of ANG with MIRROR in WCS
- Circle end point tolerance increased
- Circle end point tolerance increased

#### v0.0.37
- critical rounding bug fix
7 changes: 4 additions & 3 deletions lib/interpretator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {loadSnippet} from "./snippets";

var fs = require("fs-extra");
var path = require("path");
const {dialog} = require("remote");
const {dialog} = require("electron").remote;


import View from './sinumerik'
Expand Down Expand Up @@ -3132,7 +3132,7 @@ export function mathParse(expression, programName) {

// console.log('mathParse: ' + expression);

// console.log('input string: ' + expression);
// console.log('input string: ' + expression);
for (let i = 0; i < replacements.Math.desired.length; i++) {
var regEx = new RegExp(`(?<!\\w)${replacements.Math.desired[i]}(?=\\W?)`);
var while_iter = 0;
Expand Down Expand Up @@ -3225,7 +3225,8 @@ export function mathParse(expression, programName) {
eval(codeString);
value = value.toString()
if (value.match(/\d\.\d{6,50}/)) {
value = value.replace(value.match(/\d\.\d{6,50}/)[0], parseFloat(value.match(/\d\.\d{6,50}/)[0]).toFixed(5))
// value = value.replace(value.match(/\d\.\d{6,50}/)[0], parseFloat(value.match(/\d\.\d{6,50}/)[0]).toFixed(5))
value = parseFloat(value).toFixed(5).toString()
}
return Number.parseFloat(value) //.toFixed(5);
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sinumerik-highlight",
"main": "./lib/sinumerik",
"version": "0.0.36",
"version": "0.0.37",
"description": "Sinumerik highlight",
"keywords": [],
"activationCommands": {
Expand Down

0 comments on commit 783e9e3

Please sign in to comment.