Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362834 - Expect extra decimals to be truncated rather than rounded
Summary: Expect extra decimals to be truncated rather than rounded
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 15:32 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:17 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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