daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Vue.filter('toEuro', function(value) {
  2.     if (value !== undefined && value !== null && parseInt(value) !== 0) {
  3.         return Number(value).toLocaleString('fr-FR', {style: "currency", currency: 'EUR', minimumFractionDigits: 0, maximumFractionDigits: 2, useGrouping: true});
  4.     } else {
  5.         return 'NC';
  6.     }
  7. });
  8. Vue.filter('numberFormat', function(value) {
  9.     if (value !== undefined) {
  10.         return Number(value).toLocaleString();
  11.     } else {
  12.         return 0;
  13.     }
  14. });
  15. Vue.filter('squareMeters', function(value) {
  16.     if (value !== undefined) {
  17.         return Number(value).toLocaleString() + ' m²';
  18.     } else {
  19.         return '';
  20.     }
  21. });
  22. Vue.filter('boolToText', function(value) {
  23.     return value == true ? 'Oui' : 'Non';
  24. });
  25. Vue.filter('lowercase', function(value) {
  26.     return String(value).toLowerCase();
  27. });
  28. Vue.filter('uppercase', function(value) {
  29.     return String(value).toUpperCase();
  30. });
  31. Vue.filter('formatDateLetters', function(value) {
  32.     if (value) {
  33.         return moment(String(value)).format('DD MMMM YYYY');
  34.     }
  35. });
  36. Vue.filter('phoneNumber', function(phone) {
  37.     return phone.replace(/[^0-9]/g, '')
  38.         .replace(/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, '$1 $2 $3 $4 $5');
  39. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top