Skip to content

Commit

Permalink
Create temperatureconverter.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gsilvamartin authored Feb 25, 2024
1 parent dba65e6 commit 1b116fb
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions docs/docs/converters/temperatureconverter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# TemperatureConverter Class

**A static class providing methods for converting temperatures between Celsius, Fahrenheit, and Kelvin.**

## Class Members

```csharp
CelsiusToFahrenheit<T>(T temperature)
```

Converts a temperature from Celsius to Fahrenheit.

### Parameters

- `temperature` (Type: `T`): The temperature in Celsius to convert. `T` should implement the `IConvertible` interface.

### Returns

- Type: `double`
- Description: The converted temperature in Fahrenheit.

### Example

```csharp
double celsius = 25;
double fahrenheit = TemperatureConverter.CelsiusToFahrenheit(celsius);
Console.WriteLine(fahrenheit);
```

### Remarks

The `CelsiusToFahrenheit` method converts a temperature from Celsius to Fahrenheit.

---

```csharp
CelsiusToKelvin<T>(T temperature)
```

Converts a temperature from Celsius to Kelvin.

### Parameters

- `temperature` (Type: `T`): The temperature in Celsius to convert. `T` should implement the `IConvertible` interface.

### Returns

- Type: `double`
- Description: The converted temperature in Kelvin.

### Example

```csharp
double celsius = 25;
double kelvin = TemperatureConverter.CelsiusToKelvin(celsius);
Console.WriteLine(kelvin);
```

### Remarks

The `CelsiusToKelvin` method converts a temperature from Celsius to Kelvin.

---

**Note:** There are many more methods available in the `TemperatureConverter` class. Please refer to the reference API documentation for more details.

0 comments on commit 1b116fb

Please sign in to comment.