cms/app-client/app/helpers/int-display.js
author ymh <ymh.work@gmail.com>
Fri, 15 Sep 2017 11:26:43 +0200
changeset 546 178f9add0784
parent 481 002a05cd849f
permissions -rw-r--r--
Correct bug #28104 : affichage des titres longs dans le transcript

import Ember from 'ember';

export function intDisplay(params/*, hash*/) {
  if(!params || params.length === 0) {
    return Ember.String.htmlSafe('');
  }
  const nb = params[0];
  if(nb === Number.NEGATIVE_INFINITY || Number.isNaN(nb) || nb === Number.POSITIVE_INFINITY ) {
    return Ember.String.htmlSafe('');
  }
  return Ember.String.htmlSafe(`${nb}`);
}

export default Ember.Helper.helper(intDisplay);