---
schema_version: "1"
id: c486034efcb25dd06af99450f6c01cff5ad475b75f563fec5560115582c5014f
title: toHex
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-numbers-functions-tohex.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-numbers-functions-tohex
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8f37becb677fd096d63ba5c7206f9cbe68713039ff077f77ebf13c3580d4a82a
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# toHex

## [](#tohex1)toHex(number: Number): String

10 進数を 16 進数に変換します。

_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>number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力数値。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

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

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

```DataWeave
%dw 2.0
import toHex from dw::core::Numbers
output application/json
---
{
    a: toHex(-1),
    b: toHex(100000000000000000000000000000000000000000000000000000000000000),
    c: toHex(0),
    d: toHex(null),
    e: toHex(15),
}
```

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

```JSON
{
  "a": "-1",
  "b": "3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000",
  "c": "0",
  "d": null,
  "e": "f"
}
```

## [](#tohex2)toHex(number: Null): Null

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

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