Mikorsa16v
Member
Registered: 2nd Sep 02
Location: Burgess Hill, West Sussex
User status: Offline
|
I am currently making a database part of a group with a C++ program to gather data and it to write to the database, i figured that bit out but there is summit simple gettin on my tits now
i want a person to input a number i.e. 27 and then the field will change it to 27%, the percent format only allows numbers to be entered as a decimal i.e. 0.27 then this changes to 27%. so as it is set to the percent format, if i enter 27 it changes it to 2700% Grr ive pissed about with number formats, text formats.
i hate access
[Edited on 11-06-2003 by Mikorsa16v]
|
Gambit
Member
Registered: 5th Jun 00
Location: Common Sense HQ
User status: Offline
|
leave it as a decimal field, then when they put in 27 it appears as 27 (and a label % beside the field), but when you store it in the db you divide by 100, to keep it as a percentage
then when you retrieve it again you multiply by 100 so it appears as 27
|
Mikorsa16v
Member
Registered: 2nd Sep 02
Location: Burgess Hill, West Sussex
User status: Offline
|
thats gambit, thats the theory i had, but im not sure how to divide it, its really helpful feature of putting quote marks in when i put /100 etc, isnt helpful! cheers i shall play a bit more :/
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
This won't help but bear in mind if you're playing about with numbers in C++ you'll need to cast the variable as of course you can't do maths on a string.
Sounds like you need a little macro to take the value and overright itself with the result of the division. I'll speak to our Access man in work if you're still stuck tomorrow.
|
baza31
Member
Registered: 19th Apr 03
Location: yorkshire
User status: Offline
|
How about puttin "0." in there allready
so when sum types 50
it wil be 0.50. just a thought
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Trouble with that baza, it'll be overwritten when the user types the 50 in. Plus it would need to be concatonated on, which is a string operation, which I don't think it'll let you do.
|