<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to feature-requests</title><link>https://sourceforge.net/p/fixedpoint/feature-requests/</link><description>Recent changes to feature-requests</description><atom:link href="https://sourceforge.net/p/fixedpoint/feature-requests/feed.rss" rel="self"/><language>en</language><lastBuildDate>Mon, 10 May 2004 08:26:58 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/fixedpoint/feature-requests/feed.rss" rel="self" type="application/rss+xml"/><item><title>Patch for fixedpoint to respect locale settings</title><link>https://sourceforge.net/p/fixedpoint/feature-requests/3/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;fixedpoint is currentyl "locale agnostic"&lt;/p&gt;
&lt;p&gt;That is: here in Germany the decimal_point is comma.&lt;br /&gt;
Fixedpoint ignores it and is so basically useless when&lt;br /&gt;
converting strings to fixedpoint (no, replace(",",".")&lt;br /&gt;
is not an option)&lt;/p&gt;
&lt;p&gt;The following patch around _parser can fix this issue.&lt;/p&gt;
&lt;p&gt;Open Issue locale must be set before importing&lt;br /&gt;
fixedpoint. Getting dynamic changes would require&lt;br /&gt;
re-compiling the parser string. &lt;/p&gt;
&lt;p&gt;New Code:&lt;/p&gt;
&lt;p&gt;import locale&lt;/p&gt;
&lt;p&gt;_t=r"""&lt;br /&gt;
\s*&lt;br /&gt;
(?P&amp;lt;sign&amp;gt;[-+])?&lt;br /&gt;
(&lt;br /&gt;
(?P&amp;lt;int&amp;gt;\d+) (\%(decimal_point)s (?P&amp;lt;frac&amp;gt;\d*))?&lt;br /&gt;
|&lt;br /&gt;
\%(decimal_point)s (?P&amp;lt;onlyfrac&amp;gt;\d+)&lt;br /&gt;
)&lt;br /&gt;
([eE](?P&amp;lt;exp&amp;gt;[-+]? \d+))?&lt;br /&gt;
\s* $&lt;br /&gt;
""" % locale.localeconv()&lt;/p&gt;
&lt;p&gt;_parser = re.compile(_t, re.VERBOSE).match&lt;/p&gt;
&lt;p&gt;del re&lt;br /&gt;
del locale&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Harald Armin Massa</dc:creator><pubDate>Mon, 10 May 2004 08:26:58 -0000</pubDate><guid>https://sourceforge.net00a262766e656fe627dee5ba617aa3af05e9d52a</guid></item><item><title>Power:  fp ** n</title><link>https://sourceforge.net/p/fixedpoint/feature-requests/2/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I suggest to add a primitive for '**'. Something like&lt;/p&gt;
&lt;p&gt;def __pow__(self, exponent):&lt;br /&gt;
try:&lt;br /&gt;
exp = int(exponent)&lt;br /&gt;
except:&lt;br /&gt;
raise TypeError(&amp;amp;quot;exponent not convertable to int: &amp;amp;quot; &lt;br /&gt;
+ `exponent`)&lt;br /&gt;
temp = self.copy()&lt;br /&gt;
if exp &amp;amp;lt; 1:&lt;br /&gt;
while exp &amp;amp;lt; 1:&lt;br /&gt;
temp /= self&lt;br /&gt;
exp += 1&lt;br /&gt;
else:&lt;br /&gt;
while exp &amp;amp;gt; 1:&lt;br /&gt;
temp *= self&lt;br /&gt;
exp -= 1&lt;br /&gt;
return temp&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 14 Oct 2003 04:14:57 -0000</pubDate><guid>https://sourceforge.net388400b71c414157cd4c8eaa66abe7ff98c5845a</guid></item><item><title>Auto detect precision from value</title><link>https://sourceforge.net/p/fixedpoint/feature-requests/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;If FixedPoint is constructed with:&lt;/p&gt;
&lt;p&gt;FixedPoint (&amp;amp;quot;123.456&amp;amp;quot;), you actually get FixedPoint &lt;br /&gt;
(&amp;amp;quot;123.45&amp;amp;quot;, 2), or whatever the default precision is.&lt;/p&gt;
&lt;p&gt;It would be better if the precision is not specified, that &lt;br /&gt;
the constructor recognised that value is string and set &lt;br /&gt;
the precision according to the number of decimal places &lt;br /&gt;
in the string.&lt;/p&gt;
&lt;p&gt;Same comment for when it it constructed with another &lt;br /&gt;
FixedPoint object:&lt;/p&gt;
&lt;p&gt;a = FixedPoint (&amp;amp;quot;123.456&amp;amp;quot;, 3)&lt;br /&gt;
b = FixedPoint (a)&lt;/p&gt;
&lt;p&gt;b should be set to the same precision as a.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dennis Chuah</dc:creator><pubDate>Wed, 29 Jan 2003 20:08:11 -0000</pubDate><guid>https://sourceforge.net27b987ba7be896e4881d2f59ed2149a7c5d1e361</guid></item></channel></rss>