We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b4fcdb commit 8c2207fCopy full SHA for 8c2207f
test/filters.spec.js
@@ -277,6 +277,12 @@ describe('Filters', function () {
277
expect(filter(0.974878234, 3)).toBe('97.488%')
278
expect(filter(0.0003, 1)).toBe('0.0%')
279
280
+ // different multiplier
281
+ expect(filter(0.1, 0, 150)).toBe('15%')
282
+ expect(filter(0.2, 1, 150)).toBe('30.0%')
283
+ expect(filter(1.2, 0, 300)).toBe('360%')
284
+ expect(filter(0.974878234, 3, 150)).toBe('146.232%')
285
+
286
// edge cases
287
expect(filter(undefined)).toBe('0%')
288
expect(filter(null)).toBe('0%')
@@ -285,10 +291,10 @@ describe('Filters', function () {
291
292
it('percent with global options', function () {
293
var filter = otherFilters.percent.bind({
- percent: { decimalDigits: 1 },
294
+ percent: { decimalDigits: 1, multiplier: 150 },
289
295
})
290
296
- expect(filter(100)).toBe('10000.0%')
297
+ expect(filter(100)).toBe('15000.0%')
298
299
300
it('limitByArray', function () {
0 commit comments