---
schema_version: "1"
id: 9d28b1bd32c66a6a3e59f119b0d94c1a634f461de18ffef6b62ccdfba2f3f6e0
title: ordinalize
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-strings-functions-ordinalize.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-strings-functions-ordinalize
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 582eb2100fa9160e219f4da3467292882638524c54ed3a0bd6c74cae32723a13
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# ordinalize

## [](#ordinalize1)ordinalize(Number): String

数値を序数 (​`1st`​ や ​`2nd`​ など) として返します。

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

<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>num</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">序数として返す入力数値。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力数値を序数として返します。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "a" : ordinalize(1),
  "b": ordinalize(2),
  "c": ordinalize(5),
  "d": ordinalize(103)
}
```

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

```JSON
{
   "a": "1st",
   "b": "2nd",
   "c": "5th",
   "d": "103rd"
}
```

## [](#ordinalize2)ordinalize(Null): Null

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