JsonElement.TryGetDecimal(Decimal) 方法

定義

嘗試以 Decimal 表示目前的 JSON 數字。

public:
 bool TryGetDecimal([Runtime::InteropServices::Out] System::Decimal % value);
public bool TryGetDecimal (out decimal value);
member this.TryGetDecimal : decimal -> bool
Public Function TryGetDecimal (ByRef value As Decimal) As Boolean

參數

value
Decimal

當這個方法傳回時,如果轉換成功,則包含目前 JSON 數位的十進位對等專案,如果轉換失敗則為 0。

傳回

Boolean

若數字可以表示為 Decimal,則為 true;否則為 false

例外狀況

JsonDocument 已經過處置。

備註

這個方法不會剖析 JSON 字串值的內容。

適用於