Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362834

Summary: Expect extra decimals to be truncated rather than rounded
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: broy2, jeffdouglas, jqian
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-11-03 15:32:17 EDT
JavaScript and Java should work the same for this example.  Currently they aren't the same so I went to RBD to break the tie.  (Tim says they should work the same based on the default rounding we use which is hard coded for 070 like overflow)

In RBD, truncateExtraDecimals build descriptor option toggled this option and its default is YES.  I think the default behavior in EDT should be the same.  That would mean the following code should produce "good"

		dec1 decimal(5,2) = 123.45666;
		dec2 decimal(5,2) = 123.45111;
		if (dec1 == dec2)
			syslib.writestdout("good");
		else
			syslib.writestdout("bad");
		end

An interesting note is that JavaScript in RBD doesn't honor the truncateExtraDecimal option.

Jeff, if you don't think it is possible to change java gen to support this behavior would you please change the component to language?
Comment 1 Jeff Douglas CLA 2011-11-09 17:31:11 EST
fixed
Comment 2 Kathy Carroll CLA 2011-11-11 13:16:04 EST
verified with 201111110901 and closed