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

static int net::sf::linuxorg::pcal::engine::Engine::convertTemperatureScale ( final boolean  toCelsiusScale,
final int  source 
) [inline, static]

Converts temperatures between Celsius and Fahrenheit scales

toCelsiusScale- if true, the conversion is performed from Celsius to Fahrenheit, if false - vice versa
integer- a temperature value multiplied by 10
a temperature value converted to the opposite scale and multiplied by 10

Definition at line 1558 of file Engine.java.

Referenced by changeBBTScale(), and net::sf::linuxorg::pcal::engine::EngineTest::testConvertTemperatureScale().

            if(toCelsiusScale) {
                  return java.lang.Math.round((source - 320)*5.0f/9.0f);
            } else {                
                  return java.lang.Math.round(source*9.0f/5.0f+320);

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index