cancel
Showing results for 
Search instead for 
Did you mean: 

Trailing zeroes on decimals being truncated

Former Member
0 Kudos
2,012

We just upgraded from ASA 11 to ASA 16, and are noticing some test failures because values previously retrieved as 0.0000 and 4.500 are now coming in as 0 and 4.5.

We are using the iAnywhere.Data.SQLAnywhere.v4.0 version 16.0.0.19484

Is there any setting we can change to get those zeroes preserved ?

MarkCulp
Participant
0 Kudos

Please show up the code that is generating the string data from the numeric values. I.e. what API are you using? Is the conversion to string being done on the client or the server? etc.

Former Member
0 Kudos

I will try to track down a good example.

Former Member
0 Kudos

I traced it down as far as I could. What it amounts to is we are creating a command, and doing an ExecuteReader on it, using the IDataReader interface, pointed to the iAnywhere.Data.SQLAnywhere dll. The direct value coming back from that reader is, in an example case, .051, and the same value when looked at in ISQL is .0150.

0 Kudos

Which call on the IDataReader interface are you using to get back the data?

Former Member
0 Kudos

IDataReader ExecuteReader(CommandBehavior behavior)

Former Member
0 Kudos

with CommandBehavior.Default passed in

Accepted Solutions (0)

Answers (1)

Answers (1)

jack_schueler
Advisor
Advisor

I have reproduced this change in behaviour with a simple datagrid.

SACommand      selectCmd = new SACommand( "SELECT * FROM Numerics", conn );
SADataReader   dr = selectCmd.ExecuteReader();
System.Windows.Forms.DataGrid dataGrid;
dataGrid = new System.Windows.Forms.DataGrid();
dataGrid.Location = new Point(10, 10);
dataGrid.Size = new Size(575, 200);
dataGrid.CaptionText = ".NET Example";
this.Controls.Add(dataGrid);
dataGrid.DataSource = dr;
dataGrid.Show();
dr.Close();


I will check into this.

jack_schueler
Advisor
Advisor

This is a bug that was introduced 2013/12. It will be corrected in 16.0 and 12.0.1 in an upcoming SP/EBF. The provider should only attempt to trim trailing zeroes when the precision of the incoming value exceeds Microsoft's maximum decimal precision (~29 digits).