Hi all,
I'm using Access VBA to run a query and format numeric value according to below and then send out by email.
1) if the value is 0, show a dash.
2) if it is >=1 or <= -1, show it without decimal place
3) if it is (>0 and <1) or (<0 and >-1), show it with 1 d.p. (e.g. 0.51 / -0.49)
I've tried to handle it using Format(value, "#,0;(#,0);""-"" "). However, if the value is 0.5 / -0.5, I wish to display as is, but now it will round up to 1 and display as 1.
I can use if...then...else to handle, but just curious if it can also be handled directly by the same format function?
Thanks.
I'm using Access VBA to run a query and format numeric value according to below and then send out by email.
1) if the value is 0, show a dash.
2) if it is >=1 or <= -1, show it without decimal place
3) if it is (>0 and <1) or (<0 and >-1), show it with 1 d.p. (e.g. 0.51 / -0.49)
I've tried to handle it using Format(value, "#,0;(#,0);""-"" "). However, if the value is 0.5 / -0.5, I wish to display as is, but now it will round up to 1 and display as 1.
I can use if...then...else to handle, but just curious if it can also be handled directly by the same format function?
Thanks.