Skip to content

Commit

Permalink
Remove table brackets for one export option for notedata
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Jun 6, 2024
1 parent 5244bbc commit 741717d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/gui/window/ExportNotedataWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ export class ExportNotedataWindow extends Window {

str += "}"

if (this.getNumIncludes() == 1) {
str = str.replaceAll("{", "")
str = str.replaceAll("}", "")
}

return str
})
.join(",\n") +
Expand All @@ -182,6 +187,12 @@ export class ExportNotedataWindow extends Window {
this.outputDiv!.innerText = exportText
}

private getNumIncludes() {
return Object.values(this.exportOptions.include)
.map(option => +option)
.reduce((a, b) => a + b, 0)
}

private padNum(val: number) {
if (this.exportOptions.options.padNumbers)
return (Math.round(val * 1000) / 1000).toFixed(3)
Expand Down

0 comments on commit 741717d

Please sign in to comment.