RafaelGB / obsidian-db-folder

Obsidian Plugin to Allow Notion like database based on folders
MIT License
1.23k stars 61 forks source link

[Bug]: Function column with Persist formula output ON, puts quotes on output in YAML #835

Open MGVblockist opened 1 year ago

MGVblockist commented 1 year ago

Contact Details

gaudreault.adam@gmail.com

What happened?

I have two columns, labeled 'weight' and 'quantity' that both have the Property Type "number".

The formula column is labeled 'totalweight' I am using the following column formula: ${(row.weight*row.quantity).toFixed(1)}

I have Persist Formula Output set to ON

In the YAML of the files, it adds quotations to the number... It seems like a bug to me since if you're multiplying two numbers, it should output a number.

Here is an example of how things look in the YAML:


Tags: Gear, Equipment Type: 1. Lights Alias: null Order: 13 Quantity: 3 Cost: 580 TotalCost: 1740 Weight: 9.8 TotalWeight: 29.3 totalcost: "1740.00" totalweight: "29.4"

What platform were you using?

Desktop

Version of the plugin

3.3.1

Relevant log output

No response

Are you using the latest version of the plugin in your Obsidian vault?

Are you check if there is a similar issue?

RafaelGB commented 1 year ago

thanks for the report, I will investigate it

RafaelGB commented 1 year ago

Working on this issue. It will be a new feature instead of a bug. The formulas are persisted as string always, so we can add a new dropdown column option to choose how you want to persist your formula

RafaelGB commented 1 year ago

Commit 279437eb