Xamarin.Essentials:Unit ConvertersXamarin.Essentials: Unit Converters

UnitConverters クラスは単位変換機能をいくつか備えており、Xamarin.Essentials の使用時、開発者を支援します。The UnitConverters class provides several unit converters to help developers when using Xamarin.Essentials.

作業開始Get started

この API の使用を始めるには、Xamarin.Essentials の概要ガイドを読み、ライブラリが正しくインストールされてプロジェクトに設定されていることを確認してください。To start using this API, read the getting started guide for Xamarin.Essentials to ensure the library is properly installed and set up in your projects.

Unit Converters の使用Using Unit Converters

自分のクラスの Xamarin.Essentials に参照を追加します。Add a reference to Xamarin.Essentials in your class:

using Xamarin.Essentials;

単位変換機能はすべて、Xamarin.Essentials の静的 UnitConverters クラスの使用時に利用できます。All unit converters are available by using the static UnitConverters class in Xamarin.Essentials. たとえば、華氏を摂氏に簡単に変換できます。For instance you can easily convert Fahrenheit to Celsius.

var celcius = UnitConverters.FahrenheitToCelsius(32.0);

利用できる変換の一覧:Here is a list of available conversions:

  • FahrenheitToCelsiusFahrenheitToCelsius
  • CelsiusToFahrenheitCelsiusToFahrenheit
  • CelsiusToKelvinCelsiusToKelvin
  • KelvinToCelsiusKelvinToCelsius
  • MilesToMetersMilesToMeters
  • MilesToKilometersMilesToKilometers
  • KilometersToMilesKilometersToMiles
  • DegreesToRadiansDegreesToRadians
  • RadiansToDegreesRadiansToDegrees
  • DegreesPerSecondToRadiansPerSecondDegreesPerSecondToRadiansPerSecond
  • RadiansPerSecondToDegreesPerSecondRadiansPerSecondToDegreesPerSecond
  • DegreesPerSecondToHertzDegreesPerSecondToHertz
  • RadiansPerSecondToHertzRadiansPerSecondToHertz
  • HertzToDegreesPerSecondHertzToDegreesPerSecond
  • HertzToRadiansPerSecondHertzToRadiansPerSecond
  • KilopascalsToHectopascalsKilopascalsToHectopascals
  • HectopascalsToKilopascalsHectopascalsToKilopascals
  • KilopascalsToPascalsKilopascalsToPascals
  • HectopascalsToPascalsHectopascalsToPascals
  • AtmospheresToPascalsAtmospheresToPascals
  • PascalsToAtmospheresPascalsToAtmospheres
  • CoordinatesToMilesCoordinatesToMiles
  • CoordinatesToKilometersCoordinatesToKilometers

APIAPI