View Full Version : decimal point issue on currency


antonyx
01-12-2007, 11:51 AM
ok.. this is not a hugely important issue, however.. it is a slight annoyance that i would like to resolve if it is possible..

most of my currencies will be whole numbers like twenty pounds or five pounds..

so i chose to set the decimal point to 0 which displays it like this..

£50

which is better then setting it on auto (£50.00) which my user does not like..(uneccessary zeros)

however.. every now and then there will be a carpark cost of £2.30..

if i set the decimal point to 0 then £2.30 will display as £2 which is no good..

if i set the decimal point to 1 then it will display it as £2.3 which is no good..

so is there a way to make sure that all currencies display as decimal point 0 values.. eg £34.. £2.. £145

and if a price happens to involve some pence.. such as two pounds 30 pence.. then display it as £2.30 or £103.55... etc....

i hope that is clear

mhartman
01-12-2007, 12:55 PM
Hello:

You could put the code below in the AfterUpdate event of your "Money" control:


If InStr(YourTextboxHere, ".") = 0 Then
YourTextboxHere.DecimalPlaces = "0"
Else
YourTextboxHere.DecimalPlaces = "2"
End If


Regards
Mark

antonyx
01-12-2007, 01:30 PM
yes that did it.. thank you

mhartman
01-12-2007, 02:29 PM
Your welcome and good luck with this.

Pat Hartman
01-13-2007, 11:30 AM
Doesn't setting the decimal to auto solve the problem?