Re: how to retrieve a number with more dec places

2017-03-01 Thread John English
On 01/03/2017 00:14, Bob M wrote: The prices I was saving in my table were only to 3 decimals OK, just saw this after replying to your previous post. There's usually a simple explanation when things like this happen... :) -- John English

Re: how to retrieve a number with more dec places

2017-03-01 Thread John English
On 28/02/2017 10:58, Bob M wrote: I write the price out to a file So you said, but *how* do you write it out to a file? What does your code look like? Are you for example using printf with a "%.2f" format specification, which would round the written-out value to 2 d.p.s? -- John English

Re: how to retrieve a number with more dec places

2017-02-28 Thread Bob M
Hi everybody My apologies(very red face) The prices I was saving in my table were only to 3 decimals My bad :( Bob M -- View this message in context: http://apache-database.10148.n7.nabble.com/how-to-retrieve-a-number-with-more-dec-places-tp147257p147264.html Sent from the

Re: how to retrieve a number with more dec places

2017-02-28 Thread Bob M
Hi John I write the price out to a file I wish to do simple maths e.g. subtracting one price from a second price and I need to be using all dec. places At the moment my subtraction often results in zero because of the curtailed prices When I view my Apachy table using Netbeans IDE I see the

Re: how to retrieve a number with more dec places

2017-02-28 Thread John English
On 28/02/2017 08:03, Bob M wrote: Hi I have a derby database with records that contain a price e.g. 1.21098 I retrieve it by the following line price = rs.getDouble("price"); when I print it out I get :- 1.21 How are you printing it out? The problem is probably there, not with the data

Re: how to retrieve a number with more dec places

2017-02-28 Thread Bob M
Hi I haven't tried BigDecimal To do that, what do you change the following to.. private double price = 0; Bob M -- View this message in context: http://apache-database.10148.n7.nabble.com/how-to-retrieve-a-number-with-more-dec-places-tp147257p147259.html Sent from the Apache

Re: how to retrieve a number with more dec places

2017-02-27 Thread Kristian Waagan
Hi Bob, Assuming you have stored it correctly, have you tried using getBigDecimal? -- Kristian Den tir. 28. feb. 2017, 07:03 skrev Bob M : Hi I have a derby database with records that contain a price e.g. 1.21098 I retrieve it by the following line price =

how to retrieve a number with more dec places

2017-02-27 Thread Bob M
Hi I have a derby database with records that contain a price e.g. 1.21098 I retrieve it by the following line price = rs.getDouble("price"); when I print it out I get :- 1.21 What do I need to change so that I retrieve the full price with all its decimal places? Bob M -- View this message