add implicit cast back (#696)

This commit is contained in:
Boshi Lian
2021-09-14 11:22:04 -07:00
committed by GitHub
parent b9032960e9
commit 61025a0255

View File

@@ -227,6 +227,11 @@ namespace k8s.Models
emitter?.Emit(new Scalar(ToString())); emitter?.Emit(new Scalar(ToString()));
} }
public static implicit operator decimal(ResourceQuantity v)
{
return v?.ToDecimal() ?? 0;
}
public static implicit operator ResourceQuantity(decimal v) public static implicit operator ResourceQuantity(decimal v)
{ {
return new ResourceQuantity(v, 0, SuffixFormat.DecimalExponent); return new ResourceQuantity(v, 0, SuffixFormat.DecimalExponent);