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

## [](#ordinalize1)ordinalize(num: 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(num: Null): Null

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