Created
November 23, 2024 17:07
-
-
Save brunohubner/568f3fc5f98285c06832c474a98e0e1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Notion Formulas for Time Tracking | |
| // ============================================================================= | |
| // Notion Formula to hidden field _minutes: | |
| toNumber(slice(prop("Hours"), 0, 1)) * 60 + toNumber(slice(prop("Hours"), 2, 4)) | |
| // Indented version for readability: | |
| toNumber( | |
| slice( | |
| prop("Hours"), | |
| 0, | |
| 1 | |
| ) | |
| ) * 60 + toNumber( | |
| slice( | |
| prop("Hours"), | |
| 2, | |
| 4 | |
| ) | |
| ) | |
| // ============================================================================= | |
| // Notion Formula to 'Price' field: | |
| 48 / 60 * prop("_minutes") | |
| // ============================================================================= | |
| // Notion Formula to '_hours' field: | |
| if(empty(slice(format(prop("_minutes") / 60), 1, 2)), prop("_minutes") / 60, toNumber(concat(slice(format(prop("_minutes") / 60), 0, 1),concat(".", slice(format(prop("_minutes") / 60), 2, 4))))) | |
| // Indented version for readability: | |
| if( | |
| empty( | |
| slice( | |
| format(prop("_minutes") / 60), | |
| 1, | |
| 2 | |
| ) | |
| ), | |
| prop("_minutes") / 60, | |
| toNumber( | |
| concat( | |
| slice( | |
| format(prop("_minutes") / 60), | |
| 0, | |
| 1 | |
| ), | |
| concat( | |
| ".", | |
| slice( | |
| format(prop("_minutes") / 60), | |
| 2, | |
| 4 | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) {} | |
| // created by brunohubner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment