Struct Percentage
Represents a percentage value (0-100). Provides utility methods for conversion and scaling.
Inherited Members
Namespace: PoeShared.Scaffolding
Assembly: PoeShared.dll
Syntax
public readonly struct Percentage : IEquatable<Percentage>, IFormattable
Constructors
| Name | Description |
|---|---|
| Percentage(float) | Initializes a new instance of the Percentage struct. |
Properties
| Name | Description |
|---|---|
| Value | Returns the percentage value as a float (0-100). |
Methods
| Name | Description |
|---|---|
| ApplyTo(float) | Multiplies a value by this percentage. |
| Equals(Percentage) | |
| Equals(object?) | |
| FromDecimal(double) | Converts a decimal value (0.0 to 1.0) to a percentage. |
| FromDecimal(float) | Converts a decimal value (0.0 to 1.0) to a percentage. |
| GetHashCode() | |
| ToDecimal() | Converts the percentage to a decimal value (0.0 to 1.0). |
| ToString() | |
| ToString(string, IFormatProvider) |
Operators
| Name | Description |
|---|---|
| operator ==(Percentage, Percentage) | |
| implicit operator double(Percentage) | Implicit conversion from Percentage to float. |
| implicit operator int(Percentage) | Implicit conversion from Percentage to float. |
| implicit operator float(Percentage) | Implicit conversion from Percentage to float. |
| implicit operator Percentage(double) | Implicit conversion from float to Percentage. |
| implicit operator Percentage(int) | Implicit conversion from float to Percentage. |
| implicit operator Percentage(float) | Implicit conversion from float to Percentage. |
| operator !=(Percentage, Percentage) |