Created
August 19, 2023 21:46
-
-
Save brunohubner/aa76ffd6befa76f3cecbe0f63b105170 to your computer and use it in GitHub Desktop.
Notion Formulas for Time Tracking
This file contains 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 me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment