Re: [libreoffice-users] Re: Visible currency rounding

2013-07-20 Thread Brian Barker

At 22:30 19/07/2013 -0400, Mark LaPierre wrote:

On 07/19/2013 07:26 PM, Todor Takov wrote:
I needed to implement the so called Bankers' Rounding Function, 
which would round with respect to the 4/5 rule.

[...]


Just one point I would like to make.  If you are working with money 
be sure that the total of the rounded amounts adds up to match the 
original amount.


Example:

$5.39 divided among several accounts.

10.5% to Acct A = 0.56595  = $0.57
13.5% to Acct B = 0.72765  = $0.73
17%   to Acct C = 0.9163   = $0.92
59%   to Acct D = 3.1801   = $3.18
  =
  Total = $5.40

Any summing error needs to be accounted for if you ever want your 
accounts to balance.


I'm not sure you appreciated the significance of the questioner's 
Bankers' Rounding Function.  You've given an excellent example of 
how this works.  Using banker's rounding instead of primary school 
mathematics teachers's rounding on your figures, your first 
dividend, 0.56595, would round to 0.56, not 0.57 (with no change to 
the other figures), and the total of the rounded values would be the 
required $5.39.


Brian Barker


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Base PostgreSQL Transactions

2013-07-20 Thread Andrew Douglas Pitonyak
Let me start by saying that I am not a DB expert and, although I have 
done significant work using DB and using transactions, I have not done 
so using Base or LO in general.


More comments in-line.

On 07/19/2013 04:31 PM, Don Parris wrote:

I had hoped I would find a tutorial something along the lines of:
We're going to create a way for users to enter/update data across a few
tables in a single transaction.
Here's how you do it using macros/BASIC...  Here's how you do it using the
DB's native capabilities...
In order to stop our form from entering the data into each field as we
type, we need to do so and so...
Now to collect all the data and click submit...


For all of my use cases, none of this has mattered, so I never 
considered it. I assume that you need to set autocommit to off on the 
connection.


setAutoCommit(False):

Enable (True) or disable (False) a connection's auto-commit mode. In 
auto-commit mode, all SQL statements are executed and committed as 
individual transactions. Otherwise, SQL statements are grouped into 
transactions that are terminated by a call to either commit() or 
rollback(). A commit occurs when a statement completes or the next 
execute occurs, whichever comes first. If a result set is obtained, the 
statement completes when the last row from the result set is retrieved 
or the result set is closed.


So, I assume that you would simply set auto commit to false, and then, 
when you are finished, call commit() on the transaction. Sadly, I have 
no idea at all if the Form's behavior will over-ride what you do and 
issue a commit as you fill in each sub-form.


I have no idea if you need to consider Deferrability in all this 
(deferrability is related to foreign constraints).

How does one prevent the form inserting the data on the fly - do I use
a macro?  Should I write a function or procedure on my PGSQL server to run
when the user clicks Submit in the base form?  And how do I get the
Submit action down to Postgres to run the transaction procedure?

I get the commit() function (
http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Using_DBMS_Features).
..

But isn't there a BEGIN statement?

I think what I will do is move my DB forward at its current level and read
up on transactions, triggers and procedures - as well as on LO Basic 
Macros - so I can implement the transaction stuff later.  I bet it's a lot
simpler to understand than I think.  But having to look in 20 different
locations for little pieces of info - and then figure which pieces go where
in my problem is more than I really have time for right now.

If  when I do figure it out, I'll have to write a tutorial on it for sure.

Regards,
Don


On Fri, Jul 19, 2013 at 8:56 AM, Andrew Douglas Pitonyak 
and...@pitonyak.org wrote:


The ODF Authors are working on a DB guide, I do not know the current state
of it, have you looked for it (or at it)?
https://wiki.**documentfoundation.org/images/**5/50/BH40-BaseHandbook.odthttps://wiki.documentfoundation.org/images/5/50/BH40-BaseHandbook.odt

These may also be of interest:

http://wiki.openoffice.org/**wiki/Documentation/DevGuide/**
Database/Using_DBMS_Features#**Transaction_Handlinghttp://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Using_DBMS_Features#Transaction_Handling
http://wiki.openoffice.org/**wiki/Documentation/DevGuide/**
Database/Using_DBMS_Featureshttp://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Using_DBMS_Features
http://www.openoffice.org/api/**docs/common/ref/com/sun/star/**
sdbc/TransactionIsolation.htmlhttp://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbc/TransactionIsolation.html

This document mentions transactions in passing
http://www.baseprogramming.**com/OOBasicDatabaseDev.pdfhttp://www.baseprogramming.com/OOBasicDatabaseDev.pdf

I do not remember if I discuss transactions at all in AndrewBase.odt


On 07/18/2013 04:05 PM, Don Parris wrote:


Hi all,

I have a 4-table DB in PostgreSQL to which I connect using LibreOffice
Base.  I have a form with 2 subforms in place that allows me to:
Select an existing entity (from the ENTITY table)
Add a new financial transaction (to the TRANSREC table)
Add new line items for each transaction (to the TRANSDETAILS table).

I would like to take advantage of PostGRESQL's underlying transaction
(start, rollback, commit, etc.) to ensure that a given transaction and its
line items are entered as one single transaction.  I just don't know how
to
implement that using Base as a front-end.

Maybe I really need something like macros and BASIC or Python to make such
a thing work?  If anyone knows a good tutorial on this subject, I can
certainly read - just haven't really found anything yet.


Thanks!
Don


--
Andrew Pitonyak
My Macro Document: 
http://www.pitonyak.org/**AndrewMacro.odthttp://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php



--
To unsubscribe e-mail to: 

[libreoffice-users] desktop-integration

2013-07-20 Thread Heinrich Stoellinger

Hello,
I downloaded LO 4.1.0-RC3 yesterday. Looking at the files after tar -xvf ...
I find that there still is no desktop-integration directory in the main
installation tree of files. Is it meant to be like that?
Regards
H. stoellinger

--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Visible currency rounding

2013-07-20 Thread toodr
You described it in the most precise way.
I needed a function that would round down the number if the followin digit
is less then 5,
and would round up if the followin digit is greater then 5,
and if the followin digit is equal to 5 then it will test if the last digit
to remain in the number is odd or even and then round it up if it is odd or
leave as it is if it is even.
I think this is called Round half to even as a tie braking rule.

But even more accurate description is here: 
http://www.xbeat.net/vbspeed/i_BankersRounding.htm
 
I must confess I did not have an idea that this was called Gaussian
rounding.

In my case the function needs to start from the least available right
standing digit for the given number and round consecutively from there to
the left untill the desired digit position is reached, one digit at a time .
This way it ensures that any boundary cases be treated correctly.
The practical need for this is when I had to fill in an invoice, on each row 
I wold have an intermediate number which is a result of multiplication of
amount by unit price (i.e. an item's sum), which in the general case will
not be an exact number . Then I would need to round this number to a
sensible (currency) format and only then to add the numbers up in order to
get the final amount for the invoice. In this way all numbers add up
correctly and there is no difference in the final amount.

As for the example where 23,574 rounds to 23,57 , this is the intended
result as described above.
Thanks again for the clarification you've given in your post.

Regards,
toodr



--
View this message in context: 
http://nabble.documentfoundation.org/Visible-currency-rounding-tp4065342p4066383.html
Sent from the Users mailing list archive at Nabble.com.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Visible currency rounding

2013-07-20 Thread toodr
I have given my reasons in an explanation to a post by Luuk in this present
discussion.
But I think this is not an overkill, because if we have a significantly long
number 
and we just look at the 3 digits to the right of the comma separator 
and just drop the rest of the digits to the right of them - we shall be
risking to get an incorrect result.
The correct way to round the number will be to start at the rightmost
available digit and drop one digit at a time,
untill we reach the desired digit position.
At least this is correct in my oppinion.

Regards,
toodr



--
View this message in context: 
http://nabble.documentfoundation.org/Visible-currency-rounding-tp4065342p4066388.html
Sent from the Users mailing list archive at Nabble.com.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Visible currency rounding

2013-07-20 Thread Brian Barker

At 08:54 20/07/2013 -0700, Todor Takov wrote:
I have given my reasons in an explanation to a post by Luuk in this 
present discussion.
But I think this is not an overkill, because if we have a 
significantly long number and we just look at the 3 digits to the 
right of the comma separator and just drop the rest of the digits to 
the right of them - we shall be risking to get an incorrect 
result.  The correct way to round the number will be to start at the 
rightmost available digit and drop one digit at a time, until we 
reach the desired digit position. At least this is correct in my opinion.


Paradoxically, this is certainly not the way that rounding - even 
banker's rounding - is normally achieved.


You would round 1.23456 to 1.2346 and then to 1.235 and 1.24 (using 
either scheme).
Single rounding (again using either scheme) gives 1.23.  This makes 
sense, since the original number is clearly closer to 1.23 than to 1.24.


It is a general principle that you should always round numbers once; 
if you do so repeatedly, you will indeed get different 
results.  http://en.wikipedia.org/wiki/Rounding#Double_rounding says:
In _Martinez v. Allstate_ and _Sendejo v. Farmers_, litigated 
between 1995 and 1997, the insurance companies argued that double 
rounding premiums was permissible and in fact required. The US 
courts ruled against the insurance companies and ordered them to 
adopt rules to ensure single rounding.


Some computer languages and the IEEE 754-2008 standard dictate that 
in straightforward calculations the result should not be rounded 
twice. This has been a particular problem with Java as it is 
designed to be run identically on different machines, special 
programming tricks have had to be used to achieve this with x87 
floating point.[...]


Brian Barker


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] desktop-integration

2013-07-20 Thread Mirosław Zalewski
On 20/07/2013 at 17:26, Heinrich Stoellinger hc.stoellin...@aon.at wrote:

 I downloaded LO 4.1.0-RC3 yesterday. Looking at the files after tar -xvf
 ... I find that there still is no desktop-integration directory in the
 main installation tree of files. Is it meant to be like that?

You are obviously talking about Linux, but since you did not specify 
distribution, we have to guess...

Anyway, desktop integration packages has been moved from their own directory 
into packages directory. In Debian and derivatives that is:
libreoffice4.1-debian-menus_4.1.0-3_all.deb
-- 
Best regards
Mirosław Zalewski

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] desktop-integration

2013-07-20 Thread Mirosław Zalewski
On 20/07/2013 at 19:51, Kracked_P_P---webmaster webmas...@krackedpress.com 
wrote:

 So we no longer have to do a separate install command for installing the 
 desktop menus?  So one sudo dpkg -i *.deb is all we need?

Yes, this is how it is supposed to work.
(There are some bugs in rc3 that causes package conflicts with earlier version 
of LO, so running this command might run you into trouble.)

On the other hand: if you are like me and you keep different LO versions 
installed for testing purposes, then you must take extra care to not install 
desktop-menus and not pollute your working environment with unnecessary menu 
entries.

But since this is not use-case for most of users, I believe change is for 
good.
-- 
Best regards
Mirosław Zalewski

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] desktop-integration

2013-07-20 Thread Kracked_P_P---webmaster

On 07/20/2013 02:06 PM, Mirosław Zalewski wrote:

On 20/07/2013 at 19:51, Kracked_P_P---webmaster webmas...@krackedpress.com
wrote:


So we no longer have to do a separate install command for installing the
desktop menus?  So one sudo dpkg -i *.deb is all we need?

Yes, this is how it is supposed to work.
(There are some bugs in rc3 that causes package conflicts with earlier version
of LO, so running this command might run you into trouble.)

On the other hand: if you are like me and you keep different LO versions
installed for testing purposes, then you must take extra care to not install
desktop-menus and not pollute your working environment with unnecessary menu
entries.

But since this is not use-case for most of users, I believe change is for
good.


What I now do is test a version on a different system than my main desktop.

For my Debian-based systems, I now uninstall LO before I install the new 
version.  This solves some integration issues that sometimes come up and 
the fact that sometimes my systems think I still want to run the 
previous version, say 4.0.3, when I just installed 4.0.4.


I run Ubuntu 12.04 with MATE desktop and Win7 [in a few flavors].  
Ubuntu on my main desktop [5 TB in 3 drives] and two dual booting 
laptops, plus a couple of other systems that are used only for specific 
functions- like media streaming or demoing.




--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] desktop-integration

2013-07-20 Thread sun shine

On 20/07/13 19:06, Mirosław Zalewski wrote:

On 20/07/2013 at 19:51, Kracked_P_P---webmaster webmas...@krackedpress.com
wrote:


So we no longer have to do a separate install command for installing the
desktop menus?  So one sudo dpkg -i *.deb is all we need?

Yes, this is how it is supposed to work.
(There are some bugs in rc3 that causes package conflicts with earlier version
of LO, so running this command might run you into trouble.)

On the other hand: if you are like me and you keep different LO versions
installed for testing purposes, then you must take extra care to not install
desktop-menus and not pollute your working environment with unnecessary menu
entries.

But since this is not use-case for most of users, I believe change is for
good.
In which case the installation notes for the 4.1 for *.deb need to be 
updated since they still give the two separate commands, the second 
suggesting cd to the desktop-integration directory before issuing the 
second sudo dpkg -i *.deb command.


Cheers

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] LO crashing when adding a FF theme

2013-07-20 Thread Daniel
Thanks Brad for answering.yes I do copy the url from the FF window. In 
older versions I used to do it without any problems.

You have to copy the url from the browser window into the text string
field before you click OK.  It's not clear (to me) that you're doing
that.

Anyhow, it works here with LO 4.0.3.3 in Debian testing.  I even tried
it with your chosen theme.  LO froze whilst downloading the theme, but
I'd expect that to happen.

-- 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] LO crashing when adding a FF theme

2013-07-20 Thread Kracked_P_P---webmaster

On 07/20/2013 02:40 PM, Daniel wrote:

Thanks Brad for answering.yes I do copy the url from the FF window. In 
older versions I used to do it without any problems.

You have to copy the url from the browser window into the text string
field before you click OK.  It's not clear (to me) that you're doing
that.

Anyhow, it works here with LO 4.0.3.3 in Debian testing.  I even tried
it with your chosen theme.  LO froze whilst downloading the theme, but
I'd expect that to happen.


I am using 4.0.4 on Ubuntu.  I do not see the crashing at all.

But, FF 22.0 is crashing all the timewhen I have more than two FF 
windows open.  The previous versions did not do this.


My big question is how large is the theme you are trying to use.
My simple ones
https://addons.mozilla.org/en-US/firefox/user/krackedpress/themes?sort=popular
does not cause any problems.

The froze while download seems to indicate that the theme might be 
biger than the standard simple image files.


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Importing image from LO Draw (ODG) to Writer

2013-07-20 Thread Cliff Scott
I had a one page PDF file that I wanted to break into multiple pages. Opening
the PDF with LO resulted in LO Draw opening with the file nicely displayed. I
saved it as a draw image (odg) and then expected to be able to directly
import it to Writer. Unfortunately I could find no way to do that. Even using
copy/paste resulted in a black page since the image was larger than one page.
My hope was to have it come in and naturally break into multiple pages. As a
last resort I selected a portion of the image in Draw , copy/pasted it into
Writer, inserted a page break then repeated the action on multiple pages
until the entire image was in Writer. It seems as if there must be a more
elegant way to do this. I have never used Draw before so I'm just trying to
figure out the details. To be useful it seems as if there must be an easy way
to move from Draw into Writer or Calc. Can someone help me see what I'm
missing?  Thanks.

Cliff

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Unable to change url for persona settings

2013-07-20 Thread Scott Castaline
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Just recently started checking out Fedora 19 on another system. This
version comes with LibreOffice 4.1. I found that I was not able to
setup my Persona settings in this version. My main system has 4.0.4.2
and just on a hunch I copied the libreoffice sub-dir in .config to my
test system after renaming it on that system. It now works, although I
haven't tried changing it now that I think of it since doing that.

Anyone know enough about the config db or file to shed some light on
why this happened. Also is there any major difference between config
tool in 4.0 verses 4.1 that could create problems? Or is it possible
to be a Fedora thing and not generic LibreOffice problem?


- -- 
Sent from my home PC running Fedora18 to you and NSA, FBI, CIA, HSA
and God only knows who else
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJR60/EAAoJEIefqZ0kni1dB+IP/iGdRHJaz8d+eezI1k4TUTGI
1zZFcXfHiP5B28M5stuhMZy3mWrq0PfILKptM1n0mBLV7z7U/je5SfeYxdosbhhS
G59Dn0kLSpmd8KN+VJhjSYLGk0gQu7KB3pz5w22/uJMwBXsZXOz/8DyXaFKPvEVy
JRCc9oneHT6lRP4hEigIZvaZOA+p+0PLF3xrtXBMEx3CGEor5xpyPEXkHkqr2g0a
xPklax/kLc/WOsCgrhUoUbCwmucxvEbjGubhx8JMfwe7ru0UWhwC8jr9KP+BQgKy
2rRo9Fuc/BlCZHyTezclMUlRnAB4UbnTv6CUjFVSmFKnqF407OiR45ZT+2gTZJr8
lINqidbz0NOkYM3PyR6xHC0WU/mPahu952H6Cx1nQFfJx2tujs1lXkBHNR/1V99P
c81bkhlUPkDTTkrobh41YlCtr/4v8WK9im0usscwBm/I8DHmzkgHjHQvMfemm9DX
JnPYgXerhJBFcfGeg0FkytwNwtgBDomPnFQZ+EqvLaUzzKCOycsDmn+dzTgbPe0Y
lI4u2uFoEEKBrjet7fU8YdLwD23GQNdko4YsYuLiWo/0I1BcCcMzCI8Pkj2es25x
faj/kbiS398DtvxBJIzvqyV4gXJX5jpSCllQtJ9Gucsad/TjVEwCfz89aB5dCcZq
cymFl1ZWmdh9Uc64avnq
=nSOy
-END PGP SIGNATURE-

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Augmented Matrix in Math

2013-07-20 Thread William Drago

All,

I am trying to create an augmented matrix in LO Math.

(http://en.wikipedia.org/wiki/Augmented_matrix)

The code below generates a regular matrix. To make it an 
augmented matrix I need a vertical line between the 3rd and 
4th columns.


left [matrix{1#3#2#4##2#0#1#3##5#2#2#1}
 right ]

I've had no luck with lline and riline.

The vertical line can be solid or dashed, and I'd like the 
option to use either so I can choose the one that looks best.


Thanks,
-Bill

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted