On Mon, Apr 07, 2008 at 09:48:34AM +0200, Lukas Ocilka wrote:
Arvin Schnell napsal(a):
On Wed, Mar 26, 2008 at 06:30:00PM +0100, Martin Vidner wrote:
On Wed, Mar 26, 2008 at 05:16:56PM +0100, Arvin Schnell wrote:
Hi Protectors Of YCP,
which is the easiest way to display a float with 3 digits after the decimal point and rounding to zero? Piece of, er, cake. Attached.
After introducing the builtins trunc and pow it's really a pice of cake (even with variable number of digits):
string r3(float a, integer n) { const float factor = pow(10.0, tofloat(n)); return tostring(trunc(a * factor) / factor, n); }
And again, ... we have YaST-core incompatibility with the rest of YaST. Installing the new yast2-core again means that you have to reinstall all other YaST packages.
Are you sure about that? I could add the two builtins and didn't
recompile all YaST modules. And everything works. The yast2-core
testsuite runs fine (including 9.1 bytecode compatibility tests).
Maybe you have problems with libxcrypt.
ciao Arvin
--
Arvin Schnell,