Added implicit operators
parent
abd6a15bfa
commit
12d75bbc64
|
@ -64,5 +64,14 @@ namespace ln.json
|
|||
{
|
||||
return decValue.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
|
||||
public static implicit operator Decimal(JSONNumber j) => j.decValue;
|
||||
public static implicit operator float(JSONNumber j) => (float)j.decValue;
|
||||
public static implicit operator double(JSONNumber j) => (double)j.decValue;
|
||||
public static implicit operator int(JSONNumber j) => (int)j.decValue;
|
||||
public static implicit operator long(JSONNumber j) => (long)j.decValue;
|
||||
public static implicit operator uint(JSONNumber j) => (uint)j.decValue;
|
||||
public static implicit operator ulong(JSONNumber j) => (ulong)j.decValue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,5 +97,7 @@ namespace ln.json
|
|||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static implicit operator String(JSONString j) => j.Value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
||||
<FileVersion>0.1.0.0</FileVersion>
|
||||
<PackageVersion>1.3.0-preview2</PackageVersion>
|
||||
<PackageVersion>1.3.0-preview3</PackageVersion>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
Loading…
Reference in New Issue