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

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

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

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

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