# generaltranslation: General Translation Core SDK: VariableType URL: https://generaltranslation.com/zh/docs/core/types/variable-type.mdx --- title: VariableType description: 动态内容翻译的变量格式类型枚举 --- ## 概述 `VariableType` 指定变量在译文内容中的格式化方式。 ```typescript type VariableType = 'v' | 'n' | 'd' | 'c'; ``` ## 取值 | 值 | 说明 | | ----- | ----- | | `'v'` | 纯文本替换 | | `'n'` | 数字格式 | | `'d'` | 日期格式 | | `'c'` | 货币格式 | ## 示例 ### 基本用法 ```typescript copy import { Variable, VariableType } from 'generaltranslation'; const textVar: Variable = { k: 'name', v: 'v' }; const numberVar: Variable = { k: 'count', v: 'n' }; const dateVar: Variable = { k: 'date', v: 'd' }; const currencyVar: Variable = { k: 'price', v: 'c' }; ``` ## 相关类型 * [`Variable`](/docs/core/types/Variable) - 使用 VariableType 的父类型