---
schema_version: "1"
id: 8cda5450fe94433a6c9991289d9a41f951be6492da3d26bab644fe1080ec0a2a
title: fromBinary
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-numbers-functions-frombinary.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-numbers-functions-frombinary
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4a98297a91eeba5e3692e944d42b44dba273b15e8f96449e158b9331fd21981a
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# fromBinary

## [](#frombinary1)fromBinary(String): Number

2 進数から 10 進数に変換します。

_DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。_​

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>binaryText</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>String</code>​ で表される 2 進数。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`toBinary`​ の動作を示します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import fromBinary from dw::core::Numbers
output application/json
---
{
    a: fromBinary("-10"),
    b: fromBinary("11111000111010111010110100101011100001001110000011010101100010111101001011100000100010011000011101100101101001111101111010110010010100110010100100000000000000000000000000000000000000000000000000000000000000"),
    c: fromBinary(0),
    d: fromBinary(null),
    e: fromBinary("100"),
}
```

#### [](#出力)出力

```JSON
{
  "a": -2,
  "b": 100000000000000000000000000000000000000000000000000000000000000,
  "c": 0,
  "d": null,
  "e": 4
}
```

## [](#frombinary2)fromBinary(Null): Null

`fromBinary`​ を null 値に使用できるようにするヘルパー関数。