2017-01-16 15:30:54 -02:00
|
|
|
import { Blaze } from 'meteor/blaze';
|
|
|
|
|
|
2015-11-16 17:49:35 +01:00
|
|
|
/**
|
|
|
|
|
* A global Blaze UI helper to format a float value to a specified precision
|
|
|
|
|
*/
|
2017-01-16 15:30:54 -02:00
|
|
|
Blaze.registerHelper('formatNumberPrecision', function(context, precision) {
|
2016-11-28 02:32:34 -02:00
|
|
|
if (context != null) {
|
2015-10-13 14:14:50 +02:00
|
|
|
return parseFloat(context).toFixed(precision);
|
|
|
|
|
}
|
2017-01-16 15:30:54 -02:00
|
|
|
});
|