<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [Python-Dev] Re: prePEP: Money data type</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>#- &gt;From the prePEP it's not clear (for me) the purpose of </FONT>
<BR><FONT SIZE=2>#- curencySymbol.</FONT>
<BR><FONT SIZE=2>#- If it's intended for localisation, then prefix isn't enough,</FONT>
<BR><FONT SIZE=2>#- some countries use suffix or even such format</FONT>
</P>

<P><FONT SIZE=2>The idea is to keep separated currencySymbol, thousandSeparator and decimalSeparator, in such a way that if you want to change one of those, just subclass Money and change it.</FONT></P>

<P><FONT SIZE=2>In a money amount shown as</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2> $1,234.56</FONT>
</P>

<P><FONT SIZE=2>'$' is the currencySymbol, ',' is the thousandSeparator, and '.' is the decimalSeparator.</FONT>
</P>

<P><FONT SIZE=2>This three elements are useful working with string, not only showing the amount with str(), they're also important when parsing in the creation moment:</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>#standard creation</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>m = Money('12.35')</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>#subclassing</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>class MyMoney(Money):</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>decimalSeparator = ','</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>#wrong!</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>m = MyMoney('12.35')</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>#right...</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>m = MyMoney('12,35')</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</P>
<BR>

<P><FONT SIZE=2>#- Money(123.45, 2)&nbsp; --&gt;&nbsp; 123 FF 45 GG</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#- where FF is suffix1 and GG is suffix2.</FONT>
</P>

<P><FONT SIZE=2>This maybe could be addresed with having a currencyPrefix and currencySuffix (the later default would be '') instead just one currencySymbol.</FONT></P>
<BR>
<BR>
<BR>
<BR>
<BR>

<P><B><FONT SIZE=2>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</FONT></B></P>

<P><B><U><FONT SIZE=2>ADVERTENCIA&nbsp;</FONT></U> </B>
</P>

<P><B><FONT SIZE=2>La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley. </FONT></B></P>

<P><B><FONT SIZE=2>Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. </FONT></B></P>

<P><B><FONT SIZE=2>Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada. </FONT></B></P>

<P><B><FONT SIZE=2>Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje. </FONT></B></P>

<P><B><FONT SIZE=2>Muchas Gracias.</FONT></B>
</P>

</BODY>
</HTML>