mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 21:58:54 -05:00
support fraction display
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
|
||||
|
||||
const props = defineProps({
|
||||
number: Number,
|
||||
factor: {
|
||||
@@ -22,6 +24,6 @@ import {calculateFoodAmount} from "@/utils/number_utils.ts";
|
||||
* @return {number | string}
|
||||
*/
|
||||
function calculateAmount(x) {
|
||||
return calculateFoodAmount(x, props.factor) // TODO reactive bind props
|
||||
return calculateFoodAmount(x, props.factor, useUserPreferenceStore().userSettings.useFractions)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user