If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Controlling decimal digits
Hi
I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards |
#2
|
|||
|
|||
Controlling decimal digits
On Mon, 1 Mar 2010 06:48:35 -0000, "John" wrote:
Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards Set the Format to #.00; or use the Round() function if you're calculating the value to round it to two decimals. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Controlling decimal digits
Hi John
Thanks. Using #.00 works for 1.83333 to make it 1.83 but for other numbers 2, 9.75, 12.5 it also changes them to 2.00, 12.50. How can I get round that? Basically the values are hours and it looks good if no zeros show after decimal if its a complete number. Thanks "John W. Vinson" wrote in message ... On Mon, 1 Mar 2010 06:48:35 -0000, "John" wrote: Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards Set the Format to #.00; or use the Round() function if you're calculating the value to round it to two decimals. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Controlling decimal digits
Basically I need formatting applied as below;
Before / After 2 / 2 9.75 / 9.75 12.5 / 12.5 1.83333 / 1.83 Basically if digits after decimal are more than two then round/trim to two decimal., leave everything else alone. Thanks Regards "John W. Vinson" wrote in message ... On Mon, 1 Mar 2010 06:48:35 -0000, "John" wrote: Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards Set the Format to #.00; or use the Round() function if you're calculating the value to round it to two decimals. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Controlling decimal digits
On Mon, 1 Mar 2010 07:19:54 -0000, "John" wrote:
Basically I need formatting applied as below; Before / After 2 / 2 9.75 / 9.75 12.5 / 12.5 1.83333 / 1.83 Basically if digits after decimal are more than two then round/trim to two decimal., leave everything else alone. If just using Round() doesn't work, then I don't know any *simple* way to do that. You would need some VBA code to parse the number and construct a text string with the desired decimals. -- John W. Vinson [MVP] |
#6
|
|||
|
|||
Controlling decimal digits
"John" wrote in message ... Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards |
#7
|
|||
|
|||
Controlling decimal digits
p^
"John" a écrit dans le message de groupe de discussion : ... Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards |
Thread Tools | |
Display Modes | |
|
|