Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return amount with various number of decimals
I have a calculating function in VBA which returns an amount and I have
problems regarding how to show the correct number of decimals. If the returning value has no decimal, it should show no decimal. If the returning value has 1 decimal, it should show 1 decimal. If the returning value has 2 decimals, it should show 2 decimals. If the returning value has 3 decimals or more, it should show 3 decimals. How can I solve this? Regards, S |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return amount with various number of decimals
Custom Format Cells as 0.###
-- Charles Chickering "A good example is twice the value of good advice." " wrote: I have a calculating function in VBA which returns an amount and I have problems regarding how to show the correct number of decimals. If the returning value has no decimal, it should show no decimal. If the returning value has 1 decimal, it should show 1 decimal. If the returning value has 2 decimals, it should show 2 decimals. If the returning value has 3 decimals or more, it should show 3 decimals. How can I solve this? Regards, S |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return amount with various number of decimals
format the cell as General.
-- Regards, Tom Ogilvy " wrote: I have a calculating function in VBA which returns an amount and I have problems regarding how to show the correct number of decimals. If the returning value has no decimal, it should show no decimal. If the returning value has 1 decimal, it should show 1 decimal. If the returning value has 2 decimals, it should show 2 decimals. If the returning value has 3 decimals or more, it should show 3 decimals. How can I solve this? Regards, S |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return amount with various number of decimals
format the cell as General and make the column wide enough to display as many
decimals as you would ever expect to see. -- Regards, Tom Ogilvy " wrote: I have a calculating function in VBA which returns an amount and I have problems regarding how to show the correct number of decimals. If the returning value has no decimal, it should show no decimal. If the returning value has 1 decimal, it should show 1 decimal. If the returning value has 2 decimals, it should show 2 decimals. If the returning value has 3 decimals or more, it should show 3 decimals. How can I solve this? Regards, S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
variable amount truncated regardless of # of decimals | Excel Programming | |||
Convert $ amount from excel to access? No decimals but 00 at end | Excel Worksheet Functions | |||
Conditional formatting : amount of decimals | Excel Discussion (Misc queries) | |||
Format monetary amount to 9 digits with No decimals without rounding | Excel Worksheet Functions | |||
return decimals only | Excel Discussion (Misc queries) |