Details
Description
When you use a "BigDecimal" build of QuickFIX/J, it should preserve the scale of the number inside a message. For example, if I set the Price field to be "10.3000" I should get that same value (with the trailing zeroes) back from fieldMap.getDecimal(), and similar calls. Included is a simple test.
public void testQuickFIXAssumptions() throws FieldNotFound, InvalidMessage{ BigDecimal originalPrice = new BigDecimal("10.3000"); assertEquals(4, originalPrice.scale()); Message message = new Message(); message.setField(new Price(new BigDecimal("10.3000"))); BigDecimal extractedPrice = message.getDecimal(Price.FIELD); assertEquals(4, extractedPrice.scale()); assertEquals(new BigDecimal("10.3000"), extractedPrice); String newOrderString = message.toString(); Message rehydratedMessage = new Message(newOrderString); BigDecimal rehydratedPrice = rehydratedMessage.getDecimal(Price.FIELD); assertEquals(new BigDecimal("10.3000"), rehydratedPrice); assertEquals(4, rehydratedPrice.scale()); }