2017-01-16 18:30:54 +01: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 18:30:54 +01:00
|
|
|
Blaze.registerHelper('formatNumberPrecision', function(context, precision) {
|
2016-11-28 05:32:34 +01:00
|
|
|
if (context != null) {
|
2015-10-13 14:14:50 +02:00
|
|
|
return parseFloat(context).toFixed(precision);
|
|
|
|
|
}
|
2017-01-16 18:30:54 +01:00
|
|
|
});
|