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

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

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

_DataWeave バージョン 2.2.0 で導入されました。_

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

<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(binaryText: Null): Null

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

_DataWeave バージョン 2.2.0 で導入されました。_