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. We were discussing that before but nothing has happened. The $current yast2-core should provide some unique $string (changed with every backward-incompatible change) and all another yast2 packages should require it (dependency automatically added during build). Or does anybody have a better idea? L.