PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Classifieds How do I...? (http://www.photopost.com/forum/classifieds-how-do-i/)
-   -   [4.0] Number format (http://www.photopost.com/forum/classifieds-how-do-i/142222-4-0-number-format.html)

Mike_K March 2nd, 2010 06:21 AM

[4.0] Number format
 
The number format in Classifieds is set with a point

e.g.
I have to put in shipping cost as 1.50

But in Germany (and many other countries) we write it not with a point but with a comma (1,50)

If I write it with a comma (1,50) the result is 150

I think this will confuse my users. Is there a possibility to change the format from point to comma?

Chuck S March 2nd, 2010 06:48 AM

The currency type in the program determines the actual number format

Like I know Lira and Franc use that currency format so it all depends on the currency format of that ad how things are displayed so if your currency for the ad is USD then thats why it displays like that

Mike_K March 2nd, 2010 07:03 AM

I don't understand you.

I use EURO and I can't put in a sequence of numbers separated wth a comma. It must be separated with a point. Where can I change this to a comma?

btw: Lira and Franc are not valid currencies since 18 years. They should not be in. ;)

Chuck S March 2nd, 2010 07:19 AM

Okay well try replacing this into the currency table in phpmyadmin

REPLACE INTO cp_currency VALUES (9,'Euro','EUR','€', '1');

Mike_K March 2nd, 2010 08:04 AM

I change the field type in the table currency to the values 1 and than to 2.

Both takes no effect!

Input: 5,60 or 5,6
Output: 560.00 or 56.00 €

Chuck S March 2nd, 2010 08:11 AM

If the ctype for Euro is 1 and your default currency is Euro the display should indeed change

Code:

Content visible to verified customers only.

Mike_K March 2nd, 2010 11:34 AM

The above code is from showproduct.php? Correct?


After changing the type to "1" I have the result:

Input with comma on uploadproduct.php: 5,60 / Output on showproduct.php: 560,00
Input with point on uploadproduct.php: 5.60 / Output on showproduct.php: 5,60

The output on showproduct is now correct. But I need more the input on uploadproduct correct (for me... with comma).



edit: Is this someting to edit in uploadproduct?



Code:

Content visible to verified customers only.

Chuck S March 2nd, 2010 11:45 AM

uploadproduct your simply inputting a straight 2 digit number

For display throughout the program as long as your global currency is euro and you have made the change I noted it should display like you want throughout the entire program on showcat showproduct index etc

Mike_K March 2nd, 2010 11:51 AM

Quote:

Originally Posted by Chuck S (Post 1263568)
uploadproduct your simply inputting a straight 2 digit number

You mean on uploadproduct.php? In the code? What and where is there to put in something?

Chuck S March 2nd, 2010 12:17 PM

I am not following here what your really asking because the change I gave you should change the number format for display in ads on the index etc to a comma

Mike_K March 2nd, 2010 12:59 PM

Yes, it changed the number format on showproduct! But not correct.

I want to write in the form uploadeproduct the asking price / shipping cost with comma.
E.g. 6,66

If I do that the result is in showproduct with comma, but it's now 666,00

If I fill in the form uploadproduct the digits with a point (e.g. 6.66) the result is correct with 6,66.

I am asking what to change for uploadeproduct that I can fill in there the price with comma.

Chuck S March 2nd, 2010 01:07 PM

You cant do that. The upload page should correctly say in format 0.00

what I am saying is if you changed the euro ctype to 1 then throughout the program any currency you enter will be 6,66 if you enter 6.66 on upload

Mike_K March 2nd, 2010 01:15 PM

Than we have had a problem in understanding.
My only intention was to change the format in the form uploadeproduct because our normal format is with comma.
Without that I see many problems when user see their ads listed with 1000 Euro instead of 10,00 Euro.

Chuck S March 2nd, 2010 01:20 PM

I dont think so. If your global currency is euro then unless the user changes there format the price should be 1000,00

Currency my understanding in any format is always dollars and change.

You are free to modify your uploadproduct file yourself to suit your needs cause really what your asking is there to be no change. The PHP number format for example which we use and formats based on currency places a comma or decimal in the proper place

The mysql price field in the program is a floating point 2 decimal field for numbers

My suggestion would be you edit the language string in admin to make it more clear to your users. That would probally be best.

Because if your wanting to enter 1000 euros whether its dollars or euro's it would always be 1000.00 or 1000,00

If you enter either it will display as 1000 euros

Mike_K March 2nd, 2010 01:35 PM

Chuck, the problem is not 1000 Euro or Dollar.
The problem is 10 Euro and 50 Cent (or 10 Dollar and 50 Cent).

Our separating operator for this (I guess in the whole EG) is the comma, not the point.
For this it is logical that we write also with a comma.

But when I write 10 Euro and 50 Cent (or 10 Dollar and 50 Cent) in our format it is 10,50.

10,50 (with a comma) gives the result 1050,00 (or 1050.00)

But okay....

Chuck S March 2nd, 2010 01:39 PM

Mike without modifying something you want to enter 10.50

Chuck S March 2nd, 2010 01:46 PM

Just a sidebar here as stated the field itself is a mysql float point field which is why it is 10.50

Mike_K March 2nd, 2010 01:47 PM

That I have understand. Because I don't know what to edit I must write a description in the form that the user have to place the unnormal format with a point.

.

Mike_K March 2nd, 2010 01:51 PM

Quote:

Originally Posted by Chuck S (Post 1263602)
Just a sidebar here as stated the field itself is a mysql float point field which is why it is 10.50

Yes, somewhere is to change the number format

number_format(200000); // 200,000
number_format(200000, 2, ",", "."); // 200.000,00
number_format(200000, 2, ".", ","); // 200,000.00
number_format(200000, 2, ",", ""); // 200000,00


But it's okay with me, Chuck

Chuck S March 2nd, 2010 02:48 PM

In the program the format for euro is

number_format(200000, 2, ",", "");

So that is displayed 2000,00

That is the correct format that I see

You can read up on number format at php.net


All times are GMT -5. The time now is 02:36 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97