This topic is locked

Expanding the Formating of currency

8/10/2007 10:18:46 PM
PHPRunner General questions
D
Dale author

Hey, Sergey and Team,
Quick question, one of my customers entered a large number for an amount field.

I am dealing with construction projects and costs and such. When the user entered 3billion the display of the value went all wonkey.
ie 4000000000 and it displays as $-,294,967,296

ie 5000000000 and it displays as $705,032,704
Open the records to edit or add, works and displays fine. It just in the list views and mastertable view that the numbers appear out of sort.
Im using bigint for the database format.

I believe it is in the Currency conversion routine that this is happening.

Is there something I can tweak to accept the large numbers.
Thanks in advance. Oh yeah, version 3.0.

J
Jane 8/13/2007

Dale,
you can use Custom format on the "View as" settings dialog on the Visual Editor tab.

D
Dale author 8/13/2007

Jane,
Sorry, I mentioned that I was using ver 3.0 of Phprunner at the very end of my post. I should have made this clearer and right at the start of my post.
So, I dont have a visual editor to use, so I believe I need to modify the script that converts the value to currency.

As mentioned before, the number stores correctly in the db, and when editing or adding data. It is only when viewing a list or master record on a list the large numbers display incorrectly in currency.

D
Dale author 8/15/2007

Bump*

Sergey Kornilov admin 8/15/2007

Upgrade to 4.x?

D
Dale author 8/16/2007

I kind of giggled when I seen your reply Sergey.
I worked in tech support for many years for another software company.

That would be my standard answer if someone was using an older version and the new version did not have the issue.
BUT, I have a lot of custom code in the build 3.0. Because the next version would not work with the previous Template function used in the version 3's I could not just upgrade to the 4.
I have been watching the forum with this new version, has a lot of what I had to build myself, ie Ajax dropdowns, Ajax to prepopulate many tables on change, built in batch email module, and I can go on and on.
The application I am working on is live and running with the version 3.0 build and I am finalizing some of the polish for the site. Once I am done with that, I will upgrade to the newer version and get back in sync with the program.
SO if i could impose on your great support to point me to the area where I might tweak the currency formatting to properly display large dollar values that would be great. I changed the database field from INT to BIGINT hoping this was the cause of the incorrect currency display. ALas, it made no difference, so Im thinking it must be in the function itself that you build the currency value to display. I may not be correct, just hoping.
If there is nothing I can do with the 3.0 version then I will drop the issue, and try to find another quick solution.

J
Jane 8/17/2007

Dale,
try to edit format_currency function in the include/locale.php file manually.

Also you can replace format_currency function with your own function.

D
Dale author 8/17/2007

Thankyou Jane for pointing out where I need to be.

That's exactly what I was looking for. Just the where.

Sorry for taking so much time on supporting an older version. I appreciate it.

Sergey Kornilov admin 8/17/2007

Dale,
I hope my advise to upgrade didn't sound rude. That actually meant that I don't have a quick answer and I didn't know you talking about changes to the existing live application.
The more people use the latest version the easier our live is.