Adobe® Flash® Platform 用 ActionScript® 3.0 リファレンスガイド
ホーム  |  パッケージおよびクラスリストの非表示 |  パッケージ  |  クラス  |  新機能  |  索引  |  付録  |  英語で表示される理由
フィルター: AIR 30.0 以前, Flash Player 30.0 以前, Flash Lite 4
Flex 4.6 以前, Flash Pro CS6 以前
フィルターを非表示
flash.globalization 

CurrencyFormatter  - AS3

パッケージx

トップレベル
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

言語エレメント

グローバル定数
グローバル関数
演算子
ステートメント、キーワード、ディレクティブ
特殊な型

付録

新機能
コンパイルエラー
コンパイラー警告
ランタイムエラー
ActionScript 3 への移行
サポートされている文字セット
MXML のみのタグ
モーション XML エレメント
Timed Text タグ
使用されなくなったエレメントのリスト
Accessibility Implementation 定数
ActionScript の例の使用方法
法律上の注意
パッケージflash.globalization
クラスpublic final class CurrencyFormatter
継承CurrencyFormatter Inheritance Object

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

CurrencyFormatter クラスは、ロケールに依存した、通貨値のフォーマットと解析を可能にします。

CurrencyFormatter クラスはオペレーティングシステムで提供されるデータおよび機能を使用し、特定のロケールと通貨の種類の規則に従って通貨値をフォーマットするように設計されています。通貨記号、マイナス記号、小数点、グループ化区切り、グループ化パターン小数点およびその他の要素の位置は、ロケールによって変わります。

要求されたロケールをオペレーティングシステムがサポートする場合、プロパティと通貨の種類は、要求されたロケールの規則とデフォルトに従って設定されます。要求されたロケールを使用できない場合、プロパティは actualLocaleIDName プロパティを使用して取得できる代替またはデフォルトのシステムロケールに基づいて設定されます。

ユーザーの設定を使用し、オペレーティングシステムによって提供されるフォーマットパターンを使用し、要求されたロケールを使用できないときに代替のロケールを使用するせいで、同じロケール ID を使用していても、ユーザーによって表示されるフォーマット結果が異なる場合があります。

例を表示



パブリックプロパティ
 プロパティ定義元
  actualLocaleIDName : String
[読み取り専用] この CurrencyFormatter オブジェクトで使用される実際のロケール ID の名前。
CurrencyFormatter
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
  currencyISOCode : String
[読み取り専用] 使用される実際のロケールの 3 文字の ISO 4217。
CurrencyFormatter
  currencySymbol : String
[読み取り専用] 使用される実際のロケールの通貨記号または文字列。
CurrencyFormatter
  decimalSeparator : String
小数部を持つ通貨額のフォーマットまたは解析に使用される小数点記号。
CurrencyFormatter
  digitsType : uint
通貨額をフォーマットするときに使用される数字のセットを定義します。
CurrencyFormatter
  fractionalDigits : int
小数点記号の後に表示できる最大桁数。
CurrencyFormatter
  groupingPattern : String
フォーマットされた通貨額文字列内のグループ化区切り文字の配置を記述します。
CurrencyFormatter
  groupingSeparator : String
グループ化区切りに使用される文字または文字列。
CurrencyFormatter
  lastOperationStatus : String
[読み取り専用] この CurrencyFormatter オブジェクトが実行した最新の操作のステータス。
CurrencyFormatter
  leadingZero : Boolean
小数点区切り文字の左側に整数がない場合に、フォーマットされた金額に先頭の 0 を含めるかどうかを指定します。
CurrencyFormatter
  negativeCurrencyFormat : uint
負の通貨額のフォーマットパターンを示す数値。
CurrencyFormatter
  negativeSymbol : String
負の通貨額をフォーマットするときに使用されるマイナス記号。
CurrencyFormatter
  positiveCurrencyFormat : uint
正の金額のフォーマットパターンを示す数値。
CurrencyFormatter
  requestedLocaleIDName : String
[読み取り専用] この CurrencyFormatter オブジェクトのコンストラクターに渡された、要求されたロケール ID の名前。
CurrencyFormatter
  trailingZeros : Boolean
末尾の 0 をフォーマットされた金額に含めるかどうかを指定します。
CurrencyFormatter
  useGrouping : Boolean
通貨額をフォーマットするときにグループ化区切りを使用できるようにします。
CurrencyFormatter
パブリックメソッド
 メソッド定義元
  
CurrencyFormatter(requestedLocaleIDName:String)
所定のロケールの規則に従って通貨額を表す数字をフォーマットするために、新しい CurrencyFormatter オブジェクトを構築します。
CurrencyFormatter
  
format(value:Number, withCurrencySymbol:Boolean = false):String
ロケール、通貨記号および通貨 ISO コードを含むこの CurrencyFormatter オブジェクトの現在のプロパティに従ってフォーマットされた金額を表すストリングを作成します。
CurrencyFormatter
  
通貨額のフォーマット時に、現在指定されている通貨記号を使用できるかどうかを判別します。
CurrencyFormatter
  
[静的] このクラスでサポートされているすべてのロケール ID 名のリストが表示されます。
CurrencyFormatter
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
  
文字列を通貨額および通貨記号に解析します。
CurrencyFormatter
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
  
setCurrency(currencyISOCode:String, currencySymbol:String):void
CurrencyFormatter オブジェクトの currencyISOCode および currencySymbol プロパティを設定します。
CurrencyFormatter
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
プロパティの詳細

actualLocaleIDName

プロパティ
actualLocaleIDName:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この CurrencyFormatter オブジェクトで使用される実際のロケール ID の名前。

オペレーティングシステムおよび CurrencyFormatter() コンストラクターに渡される requestedLocaleIDName パラメーターの値に応じて、この名前は、次の 3 つの値になる可能性があります。

  1. 要求されたロケールが LocaleID.DEFAULT ではなく、要求されたロケールをオペレーティングシステムがサポートする場合、返される名前は requestedLocaleIDName プロパティと同じです。
  2. LocaleID.DEFAULT がコンストラクターに対する requestedLocaleIDName パラメーターの値として使用された場合、ユーザーのオペレーティングシステムによって指定された現在のロケールの名前が使用されます。LocaleID.DEFAULT 値により、ユーザーのカスタマイズした設定が OS に保持されます。requestedLocaleIDName パラメーターとして明示的な値を渡した場合に、2 つのロケール ID 名が同じでも LocaleID.DEFAULT を使用する場合と同じ結果になるとは限りません。ユーザーがマシンのロケール設定をカスタマイズし、LocaleID.DEFAULT を使用するのではなく、明示的なロケール ID 名を要求した場合、アプリケーションがそれらのカスタマイズされた設定を取得しない場合があります。
  3. システムがコンストラクターで指定された requestedLocaleIDName をサポートしていない場合、代替のロケール ID 名が提供されます。



実装
    public function get actualLocaleIDName():String

関連する API エレメント

currencyISOCode

プロパティ 
currencyISOCode:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

使用される実際のロケールの 3 文字の ISO 4217。

このコードは、false に設定した withCurr ncySymbol パラメーターで format() メソッドを使用して金額をフォーマットするとき、通貨記号または通貨ストリングを判別するために使用されます。

このプロパティは、使用される実際のロケールに基づいて、コンストラクターによって初期化されます。代替のロケールが使用される場合、このプロパティは、代替のロケールで優先されるデフォルトの通貨コードを反映します。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get currencyISOCode():String

関連する API エレメント

currencySymbol

プロパティ 
currencySymbol:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

使用される実際のロケールの通貨記号または文字列。

このプロパティは、withCurrencySymbol パラメーターを true に設定して、format() を使用して金額をフォーマットするときに通貨記号として使用されます。

このプロパティは、使用される実際のロケールに基づいて、コンストラクターによって初期化されます。代替のロケールが使用される場合、このプロパティは、代替のロケールで優先されるデフォルトの通貨記号を反映します。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get currencySymbol():String

関連する API エレメント

decimalSeparator

プロパティ 
decimalSeparator:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

小数部を持つ通貨額のフォーマットまたは解析に使用される小数点記号。

このプロパティは最初、formatter オブジェクトを構築するときに選択したロケールに基づいて設定されます。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get decimalSeparator():String
    public function set decimalSeparator(value:String):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

digitsType

プロパティ 
digitsType:uint

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

通貨額をフォーマットするときに使用される数字のセットを定義します。

さまざまな言語と地域で使用されるさまざまな文字セットを、0~9 の数字で表します。 このプロパティは、使用される数字のセットを定義します。

このプロパティの値は、10 進数字セットのゼロ桁の Unicode 値を表しています。このプロパティの有効な値は NationalDigitsType クラスで定義されています。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get digitsType():uint
    public function set digitsType(value:uint):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

fractionalDigits

プロパティ 
fractionalDigits:int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

小数点記号の後に表示できる最大桁数。

数字はこのプロパティによって指定された桁数に丸められます。丸めのスキームは、ユーザーのオペレーティングシステムによって異なります。

trailingZeros プロパティが true に設定されると、数字の小数部分(小数点の後)にこの fractionalDigits プロパティの値に一致する長さまで、0 が置かれます。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: 0。



実装
    public function get fractionalDigits():int
    public function set fractionalDigits(value:int):void

関連する API エレメント

groupingPattern

プロパティ 
groupingPattern:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

フォーマットされた通貨額文字列内のグループ化区切り文字の配置を記述します。

useGrouping プロパティが true に設定されると、groupingPattern プロパティを使用して、グループ化区切り文字に使用される配置とパターンが定義されます。

グループ化パターンはセミコロンで区切られ、場合によっては最後にアスタリスクが付く数字を含む文字列として定義されます。例: "3;2;*"文字列内のそれぞれの数字は、グループ内の桁数を表しています。グループセパレーターは、各数字グループの前に置かれます。ストリングの最後のアスタリスクは、その桁数を持つグループが、フォーマットされた残りのストリングで繰り返されることを示しています。アスタリスクがない場合、フォーマットされた残りのストリングに追加のグループやセパレーターはありません。

文字列内の最初の数字は、小数点の左側の数字の最初のグループに対応しています。その後に続く数字は、左側の後続のグループの桁数を定義します。 このため、文字列「3;2;*」はグループ化区切り文字が最初の 3 桁のグループの後に置かれ、その後に 2 桁のグループが続くことを示しています。例: 98,76,54,321

次の表は、さまざまなグループ化パターンによる通貨額 123456789.12 のフォーマットの例を示しています。グループ化区切りはカンマ、小数点はピリオド、ドル記号($)は通貨記号です。

グループ化パターンサンプルフォーマット
3;* $123,456,789.12
3;2;*$12,34,56,789.12
3$123456,789.12

限定された数のグループ化サイズのみ定義できます。一部のオペレーティングシステムは、グループ化パターンに 2 つの数字とアスタリスクのみ含むことができます。 その他のオペレーティングシステムは、4 つまでの数字とアスタリスクを含むことができます。アスタリスクがないパターンの場合、一部のオペレーティングシステムは 1 つの数字のみサポートし、その他のオペレーティングシステムは 3 つまでの数字をサポートします。グループ化パターン要素の最大数を超えると、追加の要素は無視され、lastOperationStatus プロパティは以下で説明するように設定されます。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。



実装
    public function get groupingPattern():String
    public function set groupingPattern(value:String):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

groupingSeparator

プロパティ 
groupingSeparator:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

グループ化区切りに使用される文字または文字列。

useGrouping プロパティが true に設定されている場合、通貨額をフォーマットするときにこのプロパティの値がグループ化区切り文字として使用されます。 このプロパティは最初、formatter オブジェクトを構築するときに選択したロケールに基づいて設定されます。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get groupingSeparator():String
    public function set groupingSeparator(value:String):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

lastOperationStatus

プロパティ 
lastOperationStatus:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この CurrencyFormatter オブジェクトが実行した最新の操作のステータス。コンストラクターまたはこのクラスのメソッドが呼び出されたり、別のプロパティが設定されたりすると、必ず lastOperationStatus プロパティが設定されます。有効な値については、各メソッドの説明を参照してください。



実装
    public function get lastOperationStatus():String

関連する API エレメント

leadingZero

プロパティ 
leadingZero:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

小数点区切り文字の左側に整数がない場合に、フォーマットされた金額に先頭の 0 を含めるかどうかを指定します。

このプロパティが true に設定されている場合、-1.0~1.0 の数値をフォーマットするときに、小数点区切り文字の左側に先頭の 0 が含まれます。このプロパティが false に設定されている場合、0 は含まれません。

例えば、金額が 0.321 でこのプロパティが true に設定されている場合、フォーマットされたストリングに先頭の 0 が含まれます。プロパティが false に設定されている場合、先頭の 0 は含まれません。その場合、文字列には、$.321 のように小数点とそれに続く 10 進数の数字のみが含まれます。

次の表は、このプロパティと fractionalDigits および trailingZeros の関連プロパティの値に基づいて通貨額をフォーマットする方法の例を示しています。

trailingZerosleadingZerofractionalDigits0.120
truetrue3$0.120$0.000
falsetrue3$0.12$0
truefalse3$.120$.000
falsefalse3$.12$0

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get leadingZero():Boolean
    public function set leadingZero(value:Boolean):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

negativeCurrencyFormat

プロパティ 
negativeCurrencyFormat:uint

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

負の通貨額のフォーマットパターンを示す数値。このパターンは、通貨額の数値部分に関連する通貨記号とマイナス記号または括弧の位置を定義します。

このプロパティの値は、下の表で定義された定数のいずれかになります。

下の表は負の通貨額の有効なフォーマットパターンの概要を示しています。通貨額が format() メソッドでフォーマットされる場合:

  • 「¤」記号は、format() メソッドに渡される withCurrencySymbol パラメーターに応じて、currencyISOCode または currencySymbol プロパティの値に置き換えられます。
  • 「-」記号は、negativeNumberSymbol プロパティの値に置き換えられます。
  • 「n」文字は、format() メソッドに渡される通貨額の値に置き換えられます。
負の金額のフォーマットの種類フォーマットパターン
0(¤n)
1-¤n
2¤-n
3¤n-
4(n¤)
5-n¤
6n-¤
7n¤-
8-n ¤
9-¤ n
10n ¤-
11¤ n-
12¤ -n
13n- ¤
14(¤ n)
15(n ¤)

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get negativeCurrencyFormat():uint
    public function set negativeCurrencyFormat(value:uint):void

例外
ArgumentError — 割り当てられた値が 0~15 の場合。

関連する API エレメント

negativeSymbol

プロパティ 
negativeSymbol:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

負の通貨額をフォーマットするときに使用されるマイナス記号。

この記号は、0 よりも小さい金額をフォーマットするときに、負の金額のフォーマットと組み合わせて使用されます。マイナス記号を含まない負の金額のフォーマットでは使用されません(例えば、負の金額が括弧で囲まれている場合)。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get negativeSymbol():String
    public function set negativeSymbol(value:String):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

positiveCurrencyFormat

プロパティ 
positiveCurrencyFormat:uint

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

正の金額のフォーマットパターンを示す数値。このフォーマットは、通貨額の数値部分に関連する通貨記号の位置を定義します。

このプロパティの値は、下の表で定義された定数のいずれかになります。

下の表は正の通貨額の有効なフォーマットパターンの概要を示しています。通貨額が format() メソッドでフォーマットされる場合:

  • 「¤」記号は、format() メソッドに渡される withCurrencySymbol パラメーターに応じて、currencyISOCode または currencySymbol プロパティの値に置き換えられます。
  • 「n」文字は、format() メソッドに渡される通貨額の値に置き換えられます。
正の金額のフォーマットの種類フォーマットパターン
0¤n
1
2¤ n
3n ¤

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get positiveCurrencyFormat():uint
    public function set positiveCurrencyFormat(value:uint):void

例外
ArgumentError — 割り当てられた値が 0~3 の場合。

関連する API エレメント

requestedLocaleIDName

プロパティ 
requestedLocaleIDName:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この CurrencyFormatter オブジェクトのコンストラクターに渡された、要求されたロケール ID の名前。

LocaleID.DEFAULT 値が使用された場合、返される名前は「i-default」です。代替のロケールが適用される場合、実際に使用されるロケールは要求されたロケールと異なる場合があります。 実際のロケール名は actualLocaleIDName プロパティを使用して取得できます。



実装
    public function get requestedLocaleIDName():String

関連する API エレメント

trailingZeros

プロパティ 
trailingZeros:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

末尾の 0 をフォーマットされた金額に含めるかどうかを指定します。

このプロパティが true に設定されている場合、末尾の 0 が fractionalDigits プロパティで指定された限界までフォーマットされた数字の小数部分に含まれます。このプロパティが false に設定されている場合、末尾の 0 は表示されません。

例えば、金額が 123.4 で、このプロパティが true に設定され、fractionalDigits プロパティが 3 に設定されている場合、フォーマットされたストリングには $123.400 のように 0 が表示されます。このプロパティが false の場合、末尾の 0 は含まれず、ストリングには $123.4 のように小数点区切り文字とその後に続く 0 以外の 10 進数の数字が表示されます。

次の表は、このプロパティと fractionalDigits および leadingZero の関連プロパティの値に基づいて通貨額をフォーマットする方法の例を示しています。

trailingZerosleadingZerofractionalDigits0.120
truetrue3$0.120$0.000
falsetrue3$0.12$0
truefalse3$.120$.000
falsefalse3$.12$0

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

デフォルト値: dependent on the actual locale and operating system。



実装
    public function get trailingZeros():Boolean
    public function set trailingZeros(value:Boolean):void

例外
TypeError — このプロパティに null 値が割り当てられている場合。

関連する API エレメント

useGrouping

プロパティ 
useGrouping:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

通貨額をフォーマットするときにグループ化区切りを使用できるようにします。

useGrouping プロパティが true に設定されている場合、数字はグループ化され、グループセパレーター文字で区切られます。例:$123,456,789

useGrouping プロパティが false に設定されている場合、数字はグループ化されず、区切られません。例:$123456789

groupingSeparator プロパティでは、グループセパレーターとして使用するシンボルを定義します。groupingPattern プロパティでは、グループセパレーター間の桁数を定義します。

このプロパティに値が割り当てられ、エラーや警告がない場合、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。



実装
    public function get useGrouping():Boolean
    public function set useGrouping(value:Boolean):void

関連する API エレメント

コンストラクターの詳細

CurrencyFormatter

()コンストラクター
public function CurrencyFormatter(requestedLocaleIDName:String)

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

所定のロケールの規則に従って通貨額を表す数字をフォーマットするために、新しい CurrencyFormatter オブジェクトを構築します。

このコンストラクターは、現在のオペレーティングシステムが要求されたロケール ID 名をサポートしているかどうかを判別します。サポートされていない場合、代わりに代替のロケールが使用されます。代替のロケールが使用される場合、lastOperationStatus プロパティに代替ロケールの種類が表示され、actualLocaleIDName プロパティには代替ロケール ID の名前が表示されます。

currencySymbolcurrencyISOCode などの一部のプロパティはロケールに基づいて自動的に設定されます。

注意:代替のロケールが使用されると、通貨プロパティがデフォルトの値に設定されます。そのため、currencySymbol または currencyISOCode プロパティに予期せぬ値が設定される場合があります。通貨額をフォーマットする前に、currencySymbol および currencyISOCode プロパティの値を調べることをお勧めします。

ユーザーの現在のオペレーティングシステムの環境設定に基づいてフォーマットするには、requestedLocaleIDName パラメーターの値 LocaleID.DEFAULT をコンストラクターに渡します。

コンストラクターが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

要求されたロケール ID 名を使用できない場合、lastOperationStatus は以下のいずれかに設定されます。

  • LastOperationStatus.USING_FALLBACK_WARNING
  • LastOperationStatus.USING_DEFAULT_WARNING

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

上記の警告および lastOperationStatus プロパティのその他の有効な値について詳しくは、LastOperationStatus クラスの説明を参照してください。

パラメーター
requestedLocaleIDName:String — 日付または時刻フォーマットを決めるときに使用する優先ロケール ID 名。

例外
TypeError requestedLocaleIDName パラメーターが null の場合。

関連する API エレメント

メソッドの詳細

format

()メソッド
public function format(value:Number, withCurrencySymbol:Boolean = false):String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

ロケール、通貨記号および通貨 ISO コードを含むこの CurrencyFormatter オブジェクトの現在のプロパティに従ってフォーマットされた金額を表すストリングを作成します。

デフォルトでは、このメソッドは currencyISOCode プロパティを使用して、フォーマット時に使用する通貨記号やその他の設定を決めます。

多くの国や地域では、さまざまな通貨に同じ通貨記号を使用しています。例えば、米国、オーストラリア、ニュージーランド、カナダおよびメキシコはすべて、国内通貨の値に同じドル記号($)を使用しています。通貨のフォーマットがユーザーの地域の通貨と異なる場合は、ISO コードを通貨ストリングとして使用することをお勧めします。formattingWithCurrencySymbolIsSafe() メソッドを使用して、フォーマットする通貨の ISO コードがフォーマッターの currencyISOCode プロパティと一致するかどうかをテストすることができます。

このメソッドで、多数の非常に高額の通貨および非常に小額の通貨をフォーマットできます。 ただし、有効桁数は Number データ型によって指定される精度に限定されます。

パラメーター

value:Number — 通貨文字列にフォーマットされる数値。
 
withCurrencySymbol:Boolean (default = false) — false に設定されている場合、currencyISOCode プロパティによって、どの通貨ストリングまたは記号を出力ストリングで使用するかが決まります。true に設定されている場合、currencySymbol プロパティの現在の値が出力ストリングで使用されます。

戻り値
String — フォーマットされた通貨値を含む文字列。

関連する API エレメント


例  ( この例の使用方法 )
この例では、要求されたロケールは「fr-CA」(フランス語(カナダ))です。この例は、このロケールがユーザーのオペレーティングシステムでサポートされており、したがって、代替のロケールは使用されないことを前提にしています。「fr-CA」の場合、デフォルトの通貨は ISO コードが CAD のカナダドルです。 したがって、デフォルト値で通貨をフォーマットすると、CAD が通貨記号として使用されます。withCurrencySymbol パラメーターが true に設定されている場合、currencySymbol プロパティを使用して、通貨額がフォーマットされます。
 
         var cf:CurrencyFormatter = new CurrencyFormatter("fr-CA");  
         
         trace(cf.actualLocaleIDName);               // "fr-CA"  
         trace(cf.currencyISOCode);                // "CAD"
         trace(cf.currencySymbol);                // "$"
         
         trace(cf.format(1254.56));                // "1 254,56 CAD"
         trace(cf.format(1254.56, true));            // "1 254,56 $"
         

2 番目の例は、デフォルトのユーザーのロケールを使用して、カナダドルで通貨額をフォーマットするメソッドを示しています。formattingWithCurrencySymbolIsSafe() メソッドを使用して、ユーザーのデフォルトの通貨がカナダドルであるかどうかをテストし、カナダドルである場合は、withCurrencySymbol パラメーターを true に設定して、format メソッドを使用します。 カナダドルでない場合は、さらに説明的な通貨記号で通貨をカナダドルに設定します。この例は、デフォルトのロケールがフランス語(カナダ)または英語(米国)の場合に、通貨をフォーマットする方法を示しています。

 
         var cf:CurrencyFormatter = new CurrencyFormatter(LocaleID.DEFAULT);  
         
         if (cf.formattingWithCurrencySymbolIsSafe("CAD")) {
           trace(cf.actualLocaleIDName);     // "fr-CA French (Canada)"
           trace(cf.format(1254.56, false)); // "1 254,56 $"
         }
         else {
           trace(cf.actualLocaleIDName);     // "en-US English (USA)"
           cf.setCurrency("CAD", "C$")
           trace(cf.format(1254.56, true));  // "C$ 1,254.56"
         }
         

formattingWithCurrencySymbolIsSafe

()メソッド 
public function formattingWithCurrencySymbolIsSafe(requestedISOCode:String):Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

通貨額のフォーマット時に、現在指定されている通貨記号を使用できるかどうかを判別します。

多くの地域や国で、同じ通貨記号が使用されています。このメソッドを使用して、あいまいな通貨記号、または代替のロケールの使用によって予期されるものとは異なる通貨記号や ISO コードが使用されるのを防ぐことができます。

このメソッドがよく使用されるのは、ロケールの通貨記号を表示するか(金額がユーザーのデフォルトの通貨でフォーマットされる場合)、またはさらに固有の ISO コード文字列を表示するか(金額がユーザーのデフォルトとは異なる通貨でフォーマットされる場合)を決めるために使用する場合です。

このメソッドは requestedISOCode パラメーターを現在の currencyISOCode プロパティと比較し、ストリングが等しい場合は true を返し、等しくない場合は false を返します。ストリングが等しい場合、withCurrencySymbol パラメーターを true に設定して format() メソッドを使用すると、ロケール固有の通貨記号を持つフォーマットされた通貨値ストリングになります。このメソッドが false を返す場合、withCurrencySymbol パラメーターを true に設定して format() メソッドを使用すると、あいまいな通貨記号または正しくない通貨記号を使用することになります。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

requestedISOCode:String — 3 文字の ISO 4217 通貨コード(米ドルは USD、ユーロは EUR など)。A~Z の 3 文字の大文字を含む必要があります。

戻り値
BooleancurrencyISOCode プロパティが requestedISOCode パラメーターと一致する場合は true、それ以外の場合 false

例外
TypeError requestedISOCode パラメーターが null の場合。

関連する API エレメント

getAvailableLocaleIDNames

()メソッド 
public static function getAvailableLocaleIDNames():Vector.<String>

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

このクラスでサポートされているすべてのロケール ID 名のリストが表示されます。

このクラスが現在のオペレーティングシステムでサポートされていない場合、このメソッドは null 値を返します。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
Vector.<String> — このクラスでサポートされているすべてのロケール ID 名を含む文字列のベクトル。

parse

()メソッド 
public function parse(inputString:String):CurrencyParseResult

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

文字列を通貨額および通貨記号に解析します。

解析アルゴリズムは decimalSeparator プロパティの値を使用して、数字の整数部分と少数部分を判別します。このアルゴリズムは、negativeCurrencyFormat および positiveCurrencyFormat プロパティの値を使用して、通貨額との関連で通貨記号または文字列の位置を決めます。負の金額の場合、negativeCurrencyFormat プロパティの値によって、負の記号の位置と括弧を使用するかどうかが決まります。

入力ストリング内の通貨記号、負の記号および数字の順序が negativeCurrencyFormat および positiveCurrencyFormat プロパティによって識別されるパターンと一致しない場合、次のようになります。

  1. 返された CurrencyParseResult オブジェクトの value プロパティが NaN に設定されます。
  2. 返された CurrencyParseResult オブジェクトの currencyString プロパティが null に設定されます。
  3. lastOperationStatus プロパティが解析の失敗を示すように設定されます。

入力ストリングには、解析中に無視される空白文字が含まれる場合があります。

通貨記号がない場合でも解析は成功します。文字列の通貨記号に該当する部分には検証は実行されませn。通貨記号またはストリングがない場合、返される CurrencyParseResult オブジェクト内の currencyString プロパティが空のストリングに設定されます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

inputString:String — 解析する入力文字列。

戻り値
CurrencyParseResult — 数値および通貨記号または文字列を含む CurrencyParseResult オブジェクト。

例外
TypeError inputString パラメーターが null の場合。

関連する API エレメント

setCurrency

()メソッド 
public function setCurrency(currencyISOCode:String, currencySymbol:String):void

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

CurrencyFormatter オブジェクトの currencyISOCode および currencySymbol プロパティを設定します。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、currencyISOCode および currencySymbol プロパティは変更されず、lastOperationStatus プロパティが LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

currencyISOCode:String — 3 文字の ISO 4217 通貨コード(米ドルは USD、ユーロは EUR など)。A~Z の 3 文字の大文字を含む必要があります。
 
currencySymbol:String — 通貨値をフォーマットするときに使用する通貨記号または文字列。これは空白文字列になる場合があります。


例外
TypeError currencyISOCode または currencySymbol パラメーターが null の場合。

関連する API エレメント

CurrencyFormatterExample.as

次に示すのは、ロケールおよび通貨に応じて通貨額を直接フォーマットする方法です。この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

この例では次のロケールを使用します。

  • 通貨フォーマットに対するオペレーティングシステムのデフォルトのロケール(LocaleID.DEFAULT
  • 日本語(日本)
  • 英語(米国)
  • フランス語(フランス)

この例では、リストの各ロケールに対して、次の処理を行います。

  1. CurrencyFormatter オブジェクトを作成します。
  2. formattingWithCurrencySymbolIsSafe() メソッドを使用して、ロケールのデフォルトの通貨がユーロ("EUR")になっているかどうかを確認し、ユーロになっている場合は、通貨記号を使用して文字列をフォーマットします。 ユーロになっていない場合は、ISO コードを使用して文字列をフォーマットします。
  
package {
    import flash.display.Sprite;
    import flash.globalization.CurrencyFormatter;
    import flash.globalization.LocaleID;
    
    public class CurrencyFormatterExample1 extends Sprite
    {
        public function CurrencyFormatterExample1():void
        {
            var cf:CurrencyFormatter;
            var amountWithSymbol:String;
            var amountWithISOCode:String
            
            var localeNames:Array = [LocaleID.DEFAULT, "ja-JP", "en-US", "fr-FR"];
            
            for each (var localeName:String in localeNames) 
            {
                cf = new CurrencyFormatter(localeName);
                
                trace('\n' + "LocaleID requested=" + cf.requestedLocaleIDName 
                    + "; actual=" + cf.actualLocaleIDName);
                
                trace("Last Operation Status: " + cf.lastOperationStatus );
                
                trace("Currency ISO Code: " + cf.currencyISOCode);
                
                if (cf.formattingWithCurrencySymbolIsSafe("EUR")) 
                {
                    amountWithSymbol = cf.format(123456789.19, true);
                    trace("Format using Symbol: "+ amountWithSymbol);
                }
                else 
                {
                    amountWithISOCode = cf.format(123456789.19); 
                    trace("Format using ISO Code: " + amountWithISOCode);
                }
            }
        }
    }
}
CurrencyFormatterParseExample.as

次の例では、指定したロケールの規則を使用して通貨額を解析します。この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

この例では、次の手順が実行されます。

  1. 英語(米国)ロケールの CurrencyFormatter オブジェクトを作成します。
  2. parse() メソッドを使用して、入力文字列を解析します。
  3. CurrencyParseResult オブジェクトの解析結果を基に、通貨額と通貨文字列の値を表示します。
 
package {
      import flash.display.Sprite;
      import flash.globalization.CurrencyFormatter;
      import flash.globalization.CurrencyParseResult;
      import flash.globalization.LastOperationStatus;
      import flash.globalization.LocaleID;

      public class CurrencyFormatterParseExample extends Sprite
      {
            public function CurrencyFormatterParseExample()
            {
                var cf:CurrencyFormatter = new CurrencyFormatter( "en_US" );
                
                trace("LocaleID requested=" + cf.requestedLocaleIDName 
                    + "; actual=" + cf.actualLocaleIDName);
                trace("Last Operation Status: " + cf.lastOperationStatus );

                var inputString:String = "Dollar 123,567,89,0.254";
                
                var result:CurrencyParseResult = cf.parse(inputString);
                
                if (cf.lastOperationStatus == LastOperationStatus.NO_ERROR ) {
                    trace("Amount value: " + result.value); 
                    trace("Currency string: " + result.currencyString); 
                }
            }
      }
}




[ X ]英語で表示される理由
ActionScript 3.0 リファレンスガイドのコンテンツが英語で表示されます。

ActionScript 3.0 リファレンスガイドのすべての部分がすべての言語に翻訳されているわけではありません。言語エレメントが翻訳されていない場合、そのエレメントは英語で表示されます。例えば、ga.controls.HelpBox クラスはどの言語にも訳されていません。このため、リファレンスガイドの日本語バージョンでは、ga.controls.HelpBox クラスは英語で表示されます。