
function fix( f ){
  f  = f.toString( );
  var re  = /\,/gi;
  f  = f.replace( re, "\." );

  f = Math.round( f * 100 );
  f = f.toString( );
  var sMinus = f.slice( 0, 1 );
  if( sMinus == '-' ){
   f = f.slice( 1, f.length )
  }
  else
   sMinus = '';
  if( f.length < 3 ) {
    while( f.length < 3 )
      f = '0' + f;
  }

  var w = sMinus + f.slice( 0, f.length-2 ) + "." + f.slice( f.length-2, f.length );

  var poprawnyFloat = /^-?[0-9]{1,}[.]{1}[0-9]{1,}$/i;
  if( w.search( poprawnyFloat ) == -1 )
    w = '0.00';
  return w;

} // end function fix

