Implement stripUnit with quantity. Oops fdescribe.
This commit is contained in:
parent
7475b5089c
commit
96244ad55c
@ -79,11 +79,7 @@ var Chartist = {
|
||||
* @return {Number} Returns the string as number or NaN if the passed length could not be converted to pixel
|
||||
*/
|
||||
Chartist.stripUnit = function(value) {
|
||||
if(typeof value === 'string') {
|
||||
value = value.replace(/[^0-9\+-\.]/g, '');
|
||||
}
|
||||
|
||||
return +value;
|
||||
return Chartist.quantity(value).value;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -280,7 +280,7 @@ describe('Chartist core', function() {
|
||||
});
|
||||
});
|
||||
|
||||
fdescribe('quantity', function() {
|
||||
describe('quantity', function() {
|
||||
|
||||
it('should return value for numbers', function() {
|
||||
expect(Chartist.quantity(100)).toEqual({ value: 100 });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user