> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 浮動小数点メタデータフィールド

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

`float`タイプのメタデータフィールドは、数値入力のみが可能な標準のテキストフィールドとしてユーザーに表示されます。

<Frame border center shadow width="400">
  <img src="https://mintcdn.com/box/Or-P29MSx7z0-Y8K/ja/guides/metadata/fields/metadata-field-float.png?fit=max&auto=format&n=Or-P29MSx7z0-Y8K&q=85&s=601972210031359c79853e4c349bacc2" alt="文字列フィールド" width="668" height="190" data-path="ja/guides/metadata/fields/metadata-field-float.png" />
</Frame>

## 浮動小数点フィールドの作成

`float`フィールドは、<Link href="/guides/metadata/templates/create">メタデータテンプレートの作成</Link>時、または`addField`操作による<Link href="/guides/metadata/templates/update">テンプレートの更新</Link>時にメタデータテンプレートに追加できます。

`float`フィールドの必須属性は、`type`、`displayName`、および`key`です。

```json theme={null}
{
  "scope": "enterprise",
  "displayName": "Contract",
  "fields": [
    {
      "type": "float",
      "key": "contract_value",
      "displayName": "Contract Value",
      "description": "The contract's total value",
      "hidden": false
    }
  ]
}
```

必要に応じて、UIでユーザーに表示される`description`を指定できます。また、このフィールドを`hidden`に設定して、ウェブアプリとモバイルアプリでユーザーに表示されないようにすることもできます。

## 浮動小数点フィールドの更新

`float`テンプレートフィールドは、このフィールドが属する<Link href="/guides/metadata/templates/update">テンプレートを更新</Link>することで更新できます。テンプレートの更新は、ファイルまたはフォルダにすでに割り当てられているテンプレートも確実に更新される**操作**によって行われます。

`float`メタデータフィールドを更新する際、関連する操作は、フィールドの`key`、`displayName`、`description`、および`hidden`の値を変更するのに使用できる`editField`操作のみです。

```json theme={null}
[
  {
    "op": "editField",
    "fieldKey": "contract_value",
    "data": {
      "displayName": "Total Annual Contract Value",
      "description": "The contract's total anual value",
      "key": "contract_tav",
      "hidden": true
    }
  }
]
```

<Warning>
  これは、このテンプレートの既存のインスタンスに影響します。
</Warning>

<RelatedLinks
  title="関連するAPI"
  items={[
{ label: translate("Update metadata template"), href: "/reference/put-metadata-templates-id-id-schema", badge: "PUT" }
]}
/>

<RelatedLinks
  title="関連するガイド"
  items={[
{ label: translate("Create a metadata template"), href: "/guides/metadata/templates/create", badge: "GUIDE" },
{ label: translate("Update a metadata template"), href: "/guides/metadata/templates/update", badge: "GUIDE" }
]}
/>
