Hello,
Finally I propose this version, lighter, simpler (more readable) to
replace my previous patch proposition.
Sorry for the double proposal.
protected function formatValueLabel():void
{
if (isNaN(_slider.value))
{
_valueLabel.text = "NaN";
}
else
{
var mult:Number = Math.pow(10, _precision);
var val:String = (Math.round(_slider.value * mult) /
mult).toString();
var parts:Array = val.split(".");
var i:uint;
if(parts[1] == null)
{
if(_precision > 0)
{
val += ".";
}
for(i; i < _precision; i++)
{
val += "0";
}
}
else if(parts[1].length < _precision)
{
var n:uint = _precision - parts[1].length;
for(i; i < n; i++)
{
val += "0";
}
}
_valueLabel.text = val;
}
positionLabel();
}
On 11 fév, 18:36, Keith Peters <
k...@bit-101.com> wrote:
> Thank you. I'll take a look tonight!
>