wip on react transition 8
This commit is contained in:
1 parent
9ae5dd25ce
commit
71b49e6766
35 files changed
+818
-470
No files matched your search
@@ -1,10 +1,14 @@
|
||||
import { Blaze } from 'meteor/blaze';
|
||||
|
||||
function formatNumberPrecision(number, precision) {
|
||||
if (number !== null) {
|
||||
return parseFloat(number).toFixed(precision);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A global Blaze UI helper to format a float value to a specified precision
|
||||
*/
|
||||
Blaze.registerHelper('formatNumberPrecision', function(context, precision) {
|
||||
if (context != null) {
|
||||
return parseFloat(context).toFixed(precision);
|
||||
}
|
||||
});
|
||||
Blaze.registerHelper('formatNumberPrecision', formatNumberPrecision);
|
||||
|
||||
export default formatNumberPrecision;
|
||||
@@ -6,6 +6,7 @@ import { isTouchDevice } from './isTouchDevice';
|
||||
import { formatPN } from './formatPN';
|
||||
import { formatDA } from './formatDA';
|
||||
import { formatTM } from './formatTM';
|
||||
import isValidNumber from './isValidNumber';
|
||||
|
||||
/**
|
||||
* Helpers with side effects only...
|
||||
@@ -13,7 +14,7 @@ import { formatTM } from './formatTM';
|
||||
|
||||
import './formatJSDate';
|
||||
import './jsDateFromNow';
|
||||
import './formatNumberPrecision';
|
||||
import formatNumberPrecision from './formatNumberPrecision';
|
||||
import './inc';
|
||||
import './isDisplaySetActive';
|
||||
import './getUsername';
|
||||
@@ -33,7 +34,9 @@ const helpers = {
|
||||
isTouchDevice,
|
||||
formatPN,
|
||||
formatDA,
|
||||
formatTM
|
||||
formatTM,
|
||||
formatNumberPrecision,
|
||||
isValidNumber,
|
||||
};
|
||||
|
||||
export { helpers };
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function isValidNumber(value) {
|
||||
return typeof value === 'number' && !isNaN(value);
|
||||
}
|
||||
Reference in new issue
Block a user