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

NumberFormatter  - 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 NumberFormatter
継承NumberFormatter Inheritance Object

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

NumberFormatter クラスは、ロケールに依存した、数値のフォーマットと解析を提供します。intuint および Number オブジェクトをフォーマットできます。

NumberFormatter クラスはオペレーティングシステムで提供されるデータおよび機能を使用し、特定のロケールの規則に従い、ユーザーの環境設定とユーザーのオペレーティングシステムによってサポートされている機能に基づいて、数字をフォーマットするように設計されています。マイナス記号、小数点の記号、グループ化の区切り文字、グループ化パターンおよび数字フォーマット内のその他の要素はロケールによって異なる場合があります。

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

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

例を表示



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

actualLocaleIDName

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

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

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

オペレーティングシステムおよび Collator() コンストラクターに渡される 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 エレメント

decimalSeparator

プロパティ 
decimalSeparator:String

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

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

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

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

  • LastOperationStatus.NO_ERROR

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

デフォルト値: dependent on the 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 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
3123456,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 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

この NumberFormatter オブジェクトが実行した前の操作のステータス。コンストラクターまたはこのクラスのメソッドが呼び出されたり、別のプロパティが設定されたりすると、必ず 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
truetrue30.1200.000
falsetrue30.120
truefalse3.120.000
falsefalse3.120

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

  • LastOperationStatus.NO_ERROR

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

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



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

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

関連する API エレメント

negativeNumberFormat

プロパティ 
negativeNumberFormat:uint

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

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

次の表は、負の数の有効なフォーマットの概要を示しています。負の数がフォーマットされると、フォーマットのマイナス記号が negativeSymbol プロパティの値に置き換えられ、「n」の文字がフォーマットされた数値に置き換えられます。

負の数のフォーマットの種類形式
0(n)
1-n
2- n
3n-
4n -

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

  • LastOperationStatus.NO_ERROR

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

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



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

例外
ArgumentError — 割り当てられた値が 0~4 の数字でない場合。

関連する API エレメント

negativeSymbol

プロパティ 
negativeSymbol:String

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

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

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

このプロパティは、このフォーマッターを構築するときに選択した実際のロケールのデフォルト値に設定されます。値を設定して、デフォルト設定を無効にすることができます。

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

  • LastOperationStatus.NO_ERROR

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



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

例外
MemoryError — システムが十分な内部メモリを割り当てることができない場合。

関連する API エレメント

requestedLocaleIDName

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

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

この NumberFormatter オブジェクトのコンストラクターに渡された、要求されたロケール 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
truetrue30.1200.000
falsetrue30.120
truefalse3.120.000
falsefalse3.120

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

  • LastOperationStatus.NO_ERROR

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

デフォルト値: dependent on the 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.22

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

グループ化区切りとして使用される記号は groupingSeparator プロパティによって定義されます。グループ化区切り間の桁数は、groupingPattern プロパティによって定義されます。

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

  • LastOperationStatus.NO_ERROR

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



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

関連する API エレメント

コンストラクターの詳細

NumberFormatter

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

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

所定のロケールの規則に基づいて数字をフォーマットするために、新しい NumberFormatter オブジェクトを構築します。

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

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

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

  • LastOperationStatus.NO_ERROR

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

  • LastOperationStatus.USING_FALLBACK_WARNING
  • LastOperationStatus.USING_DEFAULT_WARNING

このクラスが現在のオペレーティングシステムでサポートされていない場合、lastOperationStatus プロパティは次のように設定されます。

  • LastOperationStatus.UNSUPPORTED_ERROR

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

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

パラメーター
requestedLocaleIDName:String — 数字フォーマットを決めるときに使用する優先ロケール ID 名。

例外
TypeError requestedLocaleIDNamenull の場合

関連する API エレメント

メソッドの詳細

formatInt

()メソッド
public function formatInt(value:int):String

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

int 値をフォーマットします。この関数は、int 値を取ること以外は、formatNumber() メソッドと同じです。渡される値が 1.72e308 より大きい値や 1.72e-308 より小さい値のように、大きすぎるかまたは小さすぎる場合、この関数は 0 を返します。

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

  • LastOperationStatus.NO_ERROR

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

パラメーター

value:int — フォーマットする int 値。

戻り値
String — フォーマット済み数字文字列。

例外
MemoryError — 内部メモリ割り当てに問題がある場合。

関連する API エレメント

formatNumber

()メソッド 
public function formatNumber(value:Number):String

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

数値をフォーマットします。

この関数はフォーマッターのプロパティ値に基づいて数字をフォーマットします。numberFormatter オブジェクトの作成後にプロパティが変更されない場合、数字は、actualLocaleIDName によって識別されるロケールのオペレーティングシステムが提供するロケール固有の規則に従ってフォーマットされます。フォーマットをカスタマイズするために、プロパティを変更して、特定の面で数字のフォーマットを変更できます。

非常に大きな数字と非常に小さな数字をこの関数でフォーマットできます。ただし、有効桁数は Number オブジェクトによって指定される精度に限定されます。科学的記数法はサポートされていません。

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

  • LastOperationStatus.NO_ERROR

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

パラメーター

value:Number — フォーマットする数値。

戻り値
String — フォーマット済み数字文字列。

例外
MemoryError — 内部メモリ割り当てに問題がある場合。

関連する API エレメント

formatUint

()メソッド 
public function formatUint(value:uint):String

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

uint 値をフォーマットします。この関数は、uint を取ること以外 formatNumber() メソッドと同じです。 渡される値が 1.72e308 より大きいなどのように大きすぎる場合、この関数は 0 を返します。

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

  • LastOperationStatus.NO_ERROR

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

パラメーター

value:uint — uint 値。

戻り値
String — フォーマット済み数字文字列。

例外
MemoryError — 内部メモリ割り当てに問題がある場合。

関連する 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(parseString:String):NumberParseResult

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

文字列を解析して、解析した要素を含む NumberParseResult オブジェクトを返します。

NumberParseResult オブジェクトには入力文字列で見つかった最初の数字の値、文字列内の数字の開始索引、文字列内の数字の後の最初の文字の索引が含まれます。

ストリングに数字が含まれない場合、NumberParseResult の value プロパティは NaN に設定され、startIndex および endIndex プロパティは 16 進数値の 0x7fffffff に設定されます。

この関数は、decimalSeparator プロパティの値を使用して少数桁を含む数字の部分を判別し、groupingSeparator プロパティの値を使用して、数字の桁内で許容される文字を判別し、negativeNumberFormat プロパティの値を使用して、負の値を表示方法を制御します。

次の表はさまざまな NegativeNumberFormat 値で解析される文字列の結果を示しています。

NegativeNumberFormat入力文字列結果
(n)"(123)" または "( 123 )""-123"
-n"-123" または "- 123""-123"
- n"-123" または "- 123""-123"
n-"123-" または "123 -""-123"
n -"123-" または "123 -""-123"

数字とマイナス記号または括弧の間には、スペースを 1 つ入れることができます。

その他のプロパティは、有効な数字を判別するときに無視されます。特に digitsType プロパティの値が無視され、桁は NationalDigitsType クラスで列挙される桁セットのいずれかから取得できます。 groupingPattern および useGrouping プロパティの値は数字の解析に影響を与えます。

数字の前または後にプラス記号「+」が付いている場合、このプラス記号は数字の一部ではない文字として扱われます。

この関数では、科学的表記の数字(1.23e40 など)が含まれるストリングは解析されません。

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

  • LastOperationStatus.NO_ERROR

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

パラメーター

parseString:String

戻り値
NumberParseResult

例外
TypeError — parseString が null の場合

関連する API エレメント


例  ( この例の使用方法 )
次のコードで文字列から数字を解析して、接頭辞と接尾辞を取得します。
 
         var nf:NumberFormatter = new NumberFormatter("fr-FR"); 
         var str:String = "1,56 mètre"
         var result:NumberParseResult = nf.parse(str);
         trace(result.value) // 1.56
         trace(str.substr(0,result.startIndex));                // ""
         trace(str.substr(result.startIndex, result.endIndex)); // "1,56"
         trace(str.substr(result.endIndex));                    // " mètre"
         

parseNumber

()メソッド 
public function parseNumber(parseString:String):Number

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

数字とスペース(オプション)のみを含む文字列を解析して、Number を返します。文字列が数字で始まらないか、数字の一部ではないスペース以外の文字を含む場合、このメソッドは NaN を返します。 数字桁の前後のスペースは無視されます。スペース文字とは、Unicode Character Database (「http://www.unicode.org/ucd/」を参照)の Space Separator(Zs)プロパティを持つ文字のことです。

数字桁の前または後ろにプラス記号「+」が付いている場合は、空白文字以外として扱われます。戻り値は NaN です。

数字の解析および有効な数字の構成について詳しくは、解析機能の説明を参照してください。

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

  • LastOperationStatus.NO_ERROR

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

パラメーター

parseString:String

戻り値
Number

例外
TypeError — parseString が null の場合

関連する API エレメント

NumberFormatterExample.as

この例では、数字をロケールごとに異なる形式でフォーマットする方法を示します。

この例では、ユーザーのオペレーティングシステムのデフォルトのロケールである、日本語(日本)、英語(米国)およびフランス語(フランス)の各ロケールを使用して数字をフォーマットします。この例では、静的メンバー LocaleID.DEFAULT を使用して、デフォルトのオペレーティングシステムのロケールを要求します。

この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

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

  1. NumberFormatter オブジェクトを作成します。
  2. 同じ値を数字、整数、符号なし整数としてフォーマットし、結果を表示します。
 
package {
    import flash.globalization.NumberFormatter;
    import flash.globalization.LocaleID;
    
    public class NumberFormatterExample extends Sprite
    {
        public function NumberFormatterExample():void
        {
            var localeNames:Array = [LocaleID.DEFAULT,"ja_JP","en_US","fr_FR"];
            
            for ( var i:int = 0; i < localeNames.length; i++ ) 
            {
                var nf:NumberFormatter = new NumberFormatter( localeNames[i] as String );
                trace('\n\n' + "LocaleID requested: " + nf.requestedLocaleIDName 
                    + "; actual: " + nf.actualLocaleIDName);
                trace( "Last Operation Status:" + nf.lastOperationStatus );   
            
                var numberString:String = nf.formatNumber(123456789.19); 
                trace( "Formatted Number:" + numberString);
                numberString = nf.formatInt(-123456789); 
                trace( "Formatted Int:" + numberString);
                numberString = nf.formatUint(123456789); 
                trace( "Formatted UInt:" + numberString);
            }
        }
    }
}
NumberFormatterParseExample.as

この例では、入力ストリングを解析し、数値を抽出する 2 つの方法を示します。

この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

この例では、次の処理を行います。

  1. NumberFormatter オブジェクトを作成します。
  2. NumberFormatter.parse() メソッドを呼び出し、ストリングを解析して NumberParseResult オブジェクトを返します。
  3. NumberFormatter.parseNumber() メソッドを呼び出し、ストリングを解析して数値を返します。
 
package {
      import flash.globalization.NumberFormatter;
      import flash.globalization.NumberParseResult;
      import flash.globalization.LastOperationStatus;
      import flash.globalization.LocaleID;

      public class NumberFormatterParseExample
      {
            public function NumberFormatterParseExample():void
            {
                var nf:NumberFormatter = new NumberFormatter( "en_US" );
                trace("LocaleID requested: " + nf.requestedLocaleIDName 
                    + "; actual: " + nf.actualLocaleIDName);
                trace( "Last Operation Status:" + nf.lastOperationStatus );  

                var inputNumberString:String = "123,567,89,0.254";
                var parseResult:NumberParseResult = nf.parse(inputNumberString);
                if ( nf.lastOperationStatus == LastOperationStatus.NO_ERROR ) {
                    trace("Parsed value:" + parseResult.value);
                }
                inputNumberString = "-123,567,89,0.254";
                var parsedNumber:Number = nf.parseNumber(inputNumberString);
                if ( nf.lastOperationStatus == LastOperationStatus.NO_ERROR ) {
                    trace("Parsed value:" + parsedNumber);
                }
            }
      }
}




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

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