add one more test

This commit is contained in:
Peter Holmberg 2019-03-22 13:07:39 +01:00
parent 08a4c9f6fa
commit 94d129e479
2 changed files with 7 additions and 4 deletions

View File

@ -151,6 +151,13 @@ describe('Format value', () => {
expect(instance(value).text).toEqual('1.2');
});
it('should set auto decimals, 2 significant', () => {
const value = '0.0245';
const instance = getDisplayProcessor({ decimals: null });
expect(instance(value).text).toEqual('0.02');
});
it('should return mapped value if there are matching value mappings', () => {
const valueMappings: ValueMapping[] = [
{ id: 0, operator: '', text: '1-20', type: MappingType.RangeToText, from: '1', to: '20' },

View File

@ -61,10 +61,6 @@ export function getDisplayProcessor(options?: DisplayValueOptions): DisplayProce
decimals = options.decimals;
}
console.log('coin coin', value);
console.log(decimals);
console.log(scaledDecimals);
text = formatFunc(numeric, decimals, scaledDecimals, options.isUtc);
}
if (thresholds && thresholds.length > 0) {