Skip to content

Commit

Permalink
Auto-correct decimal separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Amphiluke committed Dec 2, 2023
1 parent ceb3813 commit ae2ace2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lindsvg-pwa",
"private": true,
"version": "2.2.1",
"version": "2.2.2",
"type": "module",
"scripts": {
"lint": "eslint \"src/**/*.{mjs,vue}\"",
Expand Down
12 changes: 8 additions & 4 deletions src/components/PanelSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ function toLSFormat(value) {
return value.trim().toUpperCase();
}
function toNumber(value) {
return Number(value.replace(",", "."));
}
function addNewRule() {
lSystemStore.rules[newRuleLetter.value] = toLSFormat(newRuleValue.value);
newRuleLetter.value = newRuleValue.value = "";
Expand Down Expand Up @@ -125,7 +129,7 @@ function plot() {
type="text"
inputmode="decimal"
:value="lSystemStore.alpha"
@change="lSystemStore.alpha = Number($event.target.value)"
@change="lSystemStore.alpha = toNumber($event.target.value)"
>
</label>
</div>
Expand All @@ -139,7 +143,7 @@ function plot() {
type="text"
inputmode="decimal"
:value="lSystemStore.theta"
@change="lSystemStore.theta = Number($event.target.value)"
@change="lSystemStore.theta = toNumber($event.target.value)"
>
</label>
</div>
Expand All @@ -153,7 +157,7 @@ function plot() {
type="text"
inputmode="decimal"
:value="lSystemStore.step"
@change="lSystemStore.step = Number($event.target.value)"
@change="lSystemStore.step = toNumber($event.target.value)"
>
</label>
</div>
Expand All @@ -167,7 +171,7 @@ function plot() {
type="text"
inputmode="numeric"
:value="lSystemStore.iterations"
@change="lSystemStore.iterations = Number($event.target.value)"
@change="lSystemStore.iterations = toNumber($event.target.value)"
>
</label>
</div>
Expand Down

0 comments on commit ae2ace2

Please sign in to comment.