extract out function
This commit is contained in:
parent
2b7b761737
commit
4ee00edb04
2 changed files with 7 additions and 4 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
function offersPage() {
|
const formatNumberWithSpaces = require('../utils/formatNumbersWithSpaces');
|
||||||
function formatNumberWithSpaces(num) {
|
|
||||||
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function offersPage() {
|
||||||
const navbuttonHome = document.getElementById('navbutton-home');
|
const navbuttonHome = document.getElementById('navbutton-home');
|
||||||
const navbuttonOffers = document.getElementById('navbutton-offers');
|
const navbuttonOffers = document.getElementById('navbutton-offers');
|
||||||
|
|
||||||
|
|
|
||||||
5
src/front/utils/formatNumbersWithSpaces.js
Normal file
5
src/front/utils/formatNumbersWithSpaces.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
function formatNumberWithSpaces(num) {
|
||||||
|
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = formatNumberWithSpaces;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue