FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Donations





sonam
This is not big trouble but it's little bit confuse me and maybe some new user will be more surprised then me.

Yesterday I am donate 47,42 coins to airh3ad. Day before he is donate some amount of Frih$ to me. In both situation first donation is not accepted. I didn't get his donation and he didn't get mine. Of course, I didn't loose my coins and (how I know) airh3ad didn' loose his frih$. Where is problem? The problem is in coma. We need to type dot instead of coma. For example:
47,42 - wrong amount
47.42 - right amount

My suggestion is insert simple str_replace function in donation script to avoid this trouble in future.
Code:
$user_amount= str_replace(",", ".", $user_amount);


Sonam
Ankhanu
The trouble there is that periods and commas are used differently in numbers in different parts of the world. In North America, the UK and some other nations, a period is used to separate the ones place from the tenths place, while commas are used to separate hundreds from thousands from millions from billions (every three orders of magnitude). i.e. - 4,552,948,842.56
Other systems, i.e. French, use the comma where we use the period and use a space to separate orders of magnitude: i.e. - 4 552 948 842,56

Interpreting a comma as a period could cause a lot of confusion for the system Razz
sonam
@Ankhanu

I don't want to change anything in forum system. This is type feller in my (and some other) heads and I automatically type coma instead of dot. How I can see this problem is coming only if someone donate decimal amount of coins or frih$ and this simple script can solve problem between different systems (my head and forum). Very Happy

Sonam
Ankhanu
But what happens if I, say, donate 4,986.56 Frih$ to you when this script is active?

EDIT - Nevermind, I'm pretty sure that to actually donate I'd need to type 4986.56 anyway, with no comma Razz
ocalhoun
If you're worried about the code mis-interpreting commas, you could just have the script throw up a specific error if a comma is detected anywhere in the number.

So, 4,000.56 and 4000,56 would both cause the script to give a 'transaction rejected; please try again without using commas, and using a "." for the decimal point, if needed' error...

That way, any user who has the problem will immediately know why and be able to correct it easily.

(Or, just multiply everybody's totals -- and all prices -- by 100, and don't use decimals at all any more.)
deanhills
Thanks for the tip Sonam. I'll definitely keep "commas" in mind when I make donations, i.e. not to use them. I've just tested the period, and it worked well. Very Happy
sonam
@deanhills
Thanks for donation. Rounded numbers looking great.

ocalhoun wrote:
If you're worried about the code mis-interpreting commas, you could just have the script throw up a specific error if a comma is detected anywhere in the number.

So, 4,000.56 and 4000,56 would both cause the script to give a 'transaction rejected; please try again without using commas, and using a "." for the decimal point, if needed' error...

That way, any user who has the problem will immediately know why and be able to correct it easily.


This option is also good, better then nothing.

ocalhoun wrote:

(Or, just multiply everybody's totals -- and all prices -- by 100)


But this one is not good. We are getting points, coins and before frih$ in decimal numbers. We cannot stop donation with decimals. BTW if I have 100 coins and I want to donate 13.35 coins then 13.35*100 = 1335 and I haven't enough coins for this transaction. Or I didn't good understand your point?

Sonam
saratdear
sonam wrote:
ocalhoun wrote:

(Or, just multiply everybody's totals -- and all prices -- by 100)


But this one is not good. We are getting points, coins and before frih$ in decimal numbers. We cannot stop donation with decimals. BTW if I have 100 coins and I want to donate 13.35 coins then 13.35*100 = 1335 and I haven't enough coins for this transaction. Or I didn't good understand your point?

Sonam

He mentioned multiply everyone's totals to begin with - so you'll have 10000 coins to start of with. Smile
Related topics
Gmail Invitations
Gmail?
FOR WAR OR NOT
Paid Hosting?
The downfall of american society
Donations?
why should we pay stupid people to rebuild their homes?
Rank images contest
Federal response to Katrina was faster than Hugo,
Paid hosting?
Bandwidth Limit Exceeded?
Nate
Paypal donations?
Blood donations
Donations
Reply to topic    Frihost Forum Index -> General -> Suggestions

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.