Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

double Item::getMultiplier ( const QString &  mag  )  [static, inherited]

Returns the multiplier required to get the num from human readable form to its actual value based on the SI exponent: eg 'm' returns 0.001, etc

Definition at line 500 of file item.cpp.

{
      QString mag;
      // Allow the user to enter in "u" instead of mu, as unfortunately many keyboards don't have the mu key
      if ( _mag == "u" )
            mag = QChar(0xB5);
      else
            mag = _mag;
      
      for ( int i=0; i<numPrefix; ++i )
      {
            if ( mag == SIprefix[i] )
            {
                  return std::pow( 10., (i*3)+minPrefixExp );
            }
      }
      
      // I think it is safer to return '1' if the unit is unknown
      return 1.;
//    return pow( 10., maxPrefixExp+3. );
}


Generated by  Doxygen 1.6.0   Back to index