AppleScript名:NSNumberFormatterのテスト v2 |
— Created 2014-12-03 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.5" use scripting additions use framework "Foundation" set a to 100000 set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterNoStyle) set c to b as string –> "100000" set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterDecimalStyle) set c to b as string –> "100,000" set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterCurrencyStyle) set c to b as string –> "¥100,000" set aa to 0.1 set b to current application’s NSNumberFormatter’s localizedStringFromNumber:aa numberStyle:(current application’s NSNumberFormatterPercentStyle) set c to b as string –> "10%" set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterScientificStyle) set c to b as string –> "1E5" set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterSpellOutStyle) set c to b as string –> "十万" set a to 111111111 set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterSpellOutStyle) set c to b as string –> "一億千百十一万千百十一" set a to 9.11111111111E+16 set b to current application’s NSNumberFormatter’s localizedStringFromNumber:a numberStyle:(current application’s NSNumberFormatterSpellOutStyle) set c to b as string –> "一京八千十四兆三千九百八十五億九百四十八万千九百八十四" |
More from my site
(Visited 52 times, 1 visits today)