Files
old-kivi/web/lib/helpers.js

23 lines
424 B
JavaScript
Raw Normal View History

2017-04-05 00:14:30 +02:00
export const formatPrice = (p) => {
2017-04-05 02:02:43 +02:00
if (isNaN(p)) {
2017-04-05 00:14:30 +02:00
return 'Po dogovoru'
}
return p.toLocaleString('bs') + ' KM';
}
export const formatFilterNumber = (num) => {
if (isNaN(num) || num == null) {
return ''
}
return num;
}
2017-04-10 02:50:40 +02:00
export const galleryImageUrl = (img) =>
img && img.replace("upload/", "upload/w_500/")
export const listingImageUrl = (img) =>
img && img.replace("upload/", "upload/w_205/")