Problems with prices?!

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
Chrislc
Bruji Friend
Bruji Friend
Posts: 10
Joined: Sun Jan 19, 2014 12:37 am

Problems with prices?!

Post by Chrislc »

Hello,

I downloaded and installed the latest version of bookpedia in a new computer last week.
i was importing/exporting lists/books into the new cpu/bookpedia and i realized that the prices and total are "rounded". Ex :the price 5.95 = 5.00 or 5.20=5.00..... (always rounded to the smallest numeral value)
Which means the prices are correct on the screen but the amount in the total is wrong.
it happens for price and for paid as well.

I am not sure if it is a new option i don't know, or if it is a bug? As i use bookpedia to sell books in my book shop, the total amount of value of sales and paid is important.

Thanks for the Help!

Chris

Here are the functions which are wrong. 2 books, with price 5.95, have a total of 10.00

[global:totalPrice] - Total value of the database as calculated from the 'Price' field

[global:totalPaid] - Total amount paid for the database as calculated from the 'Paid' field
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Problems with prices?!

Post by Conor »

Hi Chris,

Thank you so much for the details with all the information. But there must be an additional setting that we are missing in order to replicate the bug. Testing of 3 machines here I get the correct results. Here are two books in my wish list with price and paid with decimal values:

Image

Here is an export were I simply added Price: [global:totalPrice] Paid: [global:totalPaid] to the footer.

Image

As you can see in both the footer inside the program and the export the decimals get taken into account. Doubt the template you are using is affecting the export of the total, but you can try sending me your template and I can use it here. Also let me know how your System Preferences -> Language & Region -> Advanced -> General (tab) is setup (although I assume the default with . as the separator). Not sure what else might be affecting the total, as it's a function written by me that strips everything but numbers and .,.

Regards,
Conor
Chrislc
Bruji Friend
Bruji Friend
Posts: 10
Joined: Sun Jan 19, 2014 12:37 am

Re: Problems with prices?!

Post by Chrislc »

Hello Conor,

Here is a sreen capture where you can see above the price and cost of the book, and at the bottom the total. You will see that the price is 29,50 and you see 29.00 as a total at the bottom, on the grey bottom bar.

I will send you as well one of the list i exported from one bookpedia to the other if you need it (by email? or should i upload the file somewhere and send you the link?)

Hope it will help.

http://es.tinypic.com/view.php?pic=17fv ... Te8eHBsPoA
Chrislc
Bruji Friend
Bruji Friend
Posts: 10
Joined: Sun Jan 19, 2014 12:37 am

Re: Problems with prices?!

Post by Chrislc »

Hello Again!

I might have found where part of the problem lies. in version 5.5.0 i have on the main computer, the prices are all entered with a dot. When i export and import the list the prices stay with a dot.
In version 5.5.2, if the prices are entered with a dot, bookpedia are rounding them. If the prices are entered with a comma, everything fine.

As i have to export thousands of books, it would be a huge job to change every dots for a comma. I hope you can find a patch to make it easier! : )))))

Thanks again for everything!

Chris
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Problems with prices?!

Post by Conor »

Thank you for the image with the details. As you mentioned you are mixing the thousand separator with the decimal separator. Since your computer is set to use the comma as at the decimal separator you do need to update the data to also use the comma. Is the main computer also in Spanish? If so you can update all the dots directly on the database file for Bookpedia. This way it will be consistent across computers.

Make a backup of your database file at ~/Library/Application Support/Bookpedia, by simply making a copy of it. To open the Library folder hold down the option key and click on the Finder Go menu and select Library.

Then in the program called Terminal run the following commands, via copy paste:

Code: Select all

sqlite3 ~/Library/Application\ Support/Bookpedia/Database.bookpd
update zentry set zprice = replace(zprice, ".", ",");

This will change all the dots to commas in those fields. The export should then contain commas and be imported as commas on the new computer. Of course you can also run the same SQL update on the new computer, if you would prefer to leave the original alone.

Regards,
Conor
update zentry set zpaid = replace(zpaid, ".", ",");
.exit
Chrislc
Bruji Friend
Bruji Friend
Posts: 10
Joined: Sun Jan 19, 2014 12:37 am

Re: Problems with prices?!

Post by Chrislc »

Hello Conor,

Thanks for the answer. When you asked if the main computer was in spanish, i thought that both computers might have a different setting in the format used for the numbers. The main computer was in english and the second was in spanish. I changed, in the OS preferences, the way numbers should be handled and set up the spanish computer to use dots instead of commas. It worked.
I did not use the comand line for the terminal. Do you think i should use it anyway to fix any possible problem?

Regards
Chris
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Problems with prices?!

Post by Conor »

Changing the preferences is a perfect solution as well. I did not suggest it as it affects other apps that use numbers as well, such as Excell, you will now see the decimal separated by a dot instead of a comma. If you are okay with that, yo are good to go.

- Conor
Post Reply