make utils file

This commit is contained in:
counterweight 2025-02-24 11:24:17 +01:00
parent 86b1198e5d
commit 940b833418
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 4 additions and 4 deletions

View file

@ -73,10 +73,6 @@ function validateAndFormatEurAmountInput() {
eurAmountInput.classList.add('input-is-invalid'); eurAmountInput.classList.add('input-is-invalid');
} }
function formatNumberWithSpaces(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
}
function updateBtcInput() { function updateBtcInput() {
const eurToSatRate = 1021; const eurToSatRate = 1021;
const cleanEurAmount = readIntFromEurAmountInput(); const cleanEurAmount = readIntFromEurAmountInput();

View file

@ -0,0 +1,3 @@
function formatNumberWithSpaces(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
}

View file

@ -81,5 +81,6 @@
<%- include("partials/appCommonScripts") %> <%- include("partials/appCommonScripts") %>
<script src="/javascript/offers.js"></script> <script src="/javascript/offers.js"></script>
<script src="/javascript/utils.js"></script>
</body> </body>
</html> </html>