How to round up formulas in Button outputs #389
-
tl;dr what syntax do I need to output a rounded number from a Button? So I'm using Obsidian to store world lore for a TTRPG fantasy setting. There are two dating systems in use, and I use a couple calculations to determine the date of each calendar. When I make a new Historical Event note, I update store the respective dates in the properties as "date1" (Elven Cycle), "date2" (Imperial Calendar), and "date3" (# of Years Ago). Blah blah blah, it's needlessly complicated math. I just figured out how to use a Meta Bind Button to do the math and update those properties after I input the "Years Ago" number, but I don't know how to get the calculation to round to the nearest number (or round up to the nearest 1, either is fine). I'm brand new to anything resembling coding, so the learning curve is steep. I really appreciate your help! Here's my current codeblock:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil |
Beta Was this translation helpful? Give feedback.
probably something like