| 212 | fractionDigitsDefault = 2; |
| 213 | |
| 214 | function testFractionDigits(fractionDigits, expectedValue) { |
| 215 | |
| 216 | fabric.config.configure({ NUM_FRACTION_DIGITS: fractionDigits }); |
| 217 | |
| 218 | testedProperties.forEach(function(property) { |
| 219 | cObj.set(property, fractionalValue); |
| 220 | assert.equal(cObj.toObject()[property], expectedValue, |
| 221 | 'value of ' + property + ' should have ' + fractionDigits + ' fractional digits'); |
| 222 | }, this); |
| 223 | |
| 224 | fabric.config.configure({ NUM_FRACTION_DIGITS: fractionDigitsDefault }); |
| 225 | } |
| 226 | |
| 227 | testFractionDigits.call(this, 2, 166.67); |
| 228 | testFractionDigits.call(this, 3, 166.667); |