# UnitsConversions

# Introduction

To use these methods and features, do not forget to put this line of code in your "using" region:

C#

using LeoCorpLibrary;

VB

Imports LeoCorpLibrary

# Methods

# a. MilesToKm

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This methods allows you to convert miles to kilometers. It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.MilesToKm()

This method has one argument:

Type Argument Description
double miles Number of mile(s) to convert

Here's an example of usage:

C#

double km = UnitsConversions.MilesToKm(10);
// Expected result:
// 16.09344 km

VB

Dim km As Double = UnitsConversions.MilesToKm(10)
' Expected result:
' 16.09344 km

Go to top

# b. KmToMiles

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This method allows you to convert kilometers to miles. It return a doublevalue.

It's in:

LeoCorpLibrary.UnitsConversions.KmToMiles()

This method has one argument:

Type Argument Description
double kilometers Number of kilometers(s) to convert

Here's an example of usage:

C#

double miles = UnitsConversions.KmToMiles(10);
// Expected result :
// 6.2137119223733395 miles

VB

Dim miles As Double = UnitsConversions.KmToMiles(10)
' Expected result :
' 6.2137119223733395 miles

Go to top

# c. CelsiusToFahrenheit

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This method allows you to convert Celsius (°C) to Fahrenheit (°F). It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.CelsiusToFahrenheit()

This method has one argument:

Type Argument Description
double celsius Number of celsius to convert

Here's an example of usage:

C#

double f = UnitsConversions.CelsiusToFahrenheit(25);
// Expected result:
// 77°F

VB

Dim f As Double = UnitsConversions.CelsiusToFahrenheit(25)
' Expected result:
' 77°F

Go to top

# d. FahrenheitToCelsius

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This method allows you to convert Fahrenheit (°F) to Celsius (°C). It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.FahrenheitToCelsius()

This method has one argument:

Type Argument Description
double fahrenheit Number of fahrenheit to convert

Here's an example of usage:

C#

double c = UnitsConversions.FahrenheitToCelsius(68);
// Expected result:
// 20°C

VB

Dim c As Double = UnitsConversions.FahrenheitToCelsius(68)
' Expected result:
' 20°C

Go to top

# e. M3ToLitre

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This method allows you to convert Cubic meters (m³) to Litre (L). It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.M3ToLitre()

This method has one argument:

Type Argument Description
double m3 Number of cubic meter(s) to convert

Here's an example of usage:

C#

double l = UnitsConversions.M3ToLitre(10);
// Expected result:
// 10000L

VB

Dim l As Double = UnitsConversions.M3ToLitre(10)
' Expected result:
' 10000L

Go to top

# f. LitreToM3

This function is available in version 3.9 and higher.

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

This method allows you to convert Litre (L) to Cubic meters (m³). It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.LitreToM3()

This method has one argument:

Type Argument Description
double Number of mile(s) to convert

Here's an example of usage:

C#

double m3 = UnitsConversions.LitreToM3(2500);
// Expected result:
// 2.5 m³

VB

Dim m3 As Double = UnitsConversions.LitreToM3(2500)
' Expected result:
' 2.5 m³

Go to top

# g. FeetToMeters

This function is available in version 3.10 and higher

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The FeetToMeters() method allows you to convert feet to meters. It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.FeetToMeters()

This method has two arguments:

Value Argument Description Example
double feet Number of feet to convert 4

Here's an example of usage:

C#

double meters = UnitsConversions.FeetToMeters(5);
// Expected result: 1.52399999768352

VB

Dim meters As Double = UnitsConversions.FeetToMeters(5)
' Expected result: 1.52399999768352

Go to top

# h. MetersToFeet

This function is available in version 3.10 and higher

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The MetersToFeet() method allows you to convert meters to feet. It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.MetersToFeet()

This method has two arguments:

Value Argument Description Example
double meters Number of meters to convert 8.5

Here's an example of usage:

C#

double feet = UnitsConversions.MetersToFeet(10);
// Expected result: 32.808399

VB

Dim feet As Double = UnitsConversions.MetersToFeet(10)
' Expected result: 32.808399

Go to top

# i. PoundsToKilograms

This function is available in version 3.10 and higher

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The PoundsToKilograms() method allows you to convert pounds to kilograms. It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.PoundsToKilograms()

This method has two arguments:

Value Argument Description Example
double pounds Number of pounds to convert 12.4

Here's an example of usage:

C#

double pounds = UnitsConversions.PoundsToKilograms(20);
// Expected result: 9.071847407607567

VB

Dim pounds As Double = UnitsConversions.PoundsToKilograms(20)
' Expected result: 9.071847407607567

Go to top

# j. KilogramsToPounds

This function is available in version 3.10 and higher

Compatibility
Frameworks LeoCorpLibrary LeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The KilogramsToPounds() method allows you to convert kilograms to pounds. It returns a double value.

It's in:

LeoCorpLibrary.UnitsConversions.KilogramsToPounds()

This method has two arguments:

Value Argument Description Example
double kg Number of kilograms to convert 12.4

Here's an example of usage:

C#

double kg = UnitsConversions.KilogramsToPounds(14.5);
// Expected result: 31.96702799

VB

Dim kg As Double = UnitsConversions.KilogramsToPounds(14.5)
' Expected result: 31.96702799

Go to top