Reorganize & reformat
This commit is contained in:
20
web/src/lib/helpers.js
Normal file
20
web/src/lib/helpers.js
Normal file
@@ -0,0 +1,20 @@
|
||||
export const formatPrice = p => {
|
||||
if (isNaN(p)) {
|
||||
return 'Po dogovoru'
|
||||
}
|
||||
|
||||
return p.toLocaleString('bs') + ' KM'
|
||||
}
|
||||
|
||||
export const formatFilterNumber = num => {
|
||||
if (isNaN(num) || num == null) {
|
||||
return ''
|
||||
}
|
||||
return num
|
||||
}
|
||||
|
||||
export const galleryImageUrl = img =>
|
||||
img && img.replace('upload/', 'upload/w_500/')
|
||||
|
||||
export const listingImageUrl = img =>
|
||||
img && img.replace('upload/', 'upload/w_205/')
|
||||
Reference in New Issue
Block a user