mirror of
https://github.com/TheThomaas/my-online-cookbook.git
synced 2026-01-10 20:01:47 +00:00
change adaptQuantity function
This commit is contained in:
parent
20e9346f6d
commit
7ea7399c51
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
<script>
|
||||
function adaptQuantity (ingredient, originalServings, currentServings) {
|
||||
return ingredient.replace(/(\d|\.|,)+/, match => Number(Math.round(parseFloat(match.replace(',', '.')) * currentServings / originalServings + 'e' + 2) + 'e-' + 2));
|
||||
return ingredient.replace(/(\d|\.|,)+/, match => Number(Math.round(parseFloat(match) * currentServings / originalServings + 'e' + 2) + 'e-' + 2));
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Loading…
Reference in a new issue