Lines Matching refs:skeleton

388 // Parse the 'currencyDisplay' from the skeleton.
390 const icu::UnicodeString& skeleton) {
391 // Ex: skeleton as
393 if (skeleton.indexOf("unit-width-iso-code") >= 0) {
396 // Ex: skeleton as
398 if (skeleton.indexOf("unit-width-full-name") >= 0) {
401 // Ex: skeleton as
403 if (skeleton.indexOf("unit-width-narrow") >= 0) {
406 // Ex: skeleton as "currency/TWD .00 rounding-mode-half-up"
410 // Return true if there are no "group-off" in the skeleton.
411 bool UseGroupingFromSkeleton(const icu::UnicodeString& skeleton) {
412 return skeleton.indexOf("group-off") == -1;
416 const icu::UnicodeString& skeleton) {
419 int32_t start = skeleton.indexOf(group);
422 icu::UnicodeString check = skeleton.tempSubString(start + 6);
423 // Ex: skeleton as
428 // Ex: skeleton as
433 // Ex: skeleton as
439 // Ex: skeleton as
444 // Parse currency code from skeleton. For example, skeleton as
447 const icu::UnicodeString& skeleton) {
449 int32_t index = skeleton.indexOf(currency);
452 return skeleton.tempSubString(index, 3);
456 const icu::UnicodeString& skeleton) {
458 int32_t index = skeleton.indexOf(numbering_system);
461 const icu::UnicodeString res = skeleton.tempSubString(index);
467 // Return CurrencySign as string based on skeleton.
469 const icu::UnicodeString& skeleton) {
470 // Ex: skeleton as
473 if (skeleton.indexOf("sign-accounting") >= 0) {
479 // Return UnitDisplay as string based on skeleton.
481 const icu::UnicodeString& skeleton) {
482 // Ex: skeleton as
484 if (skeleton.indexOf("unit-width-full-name") >= 0) {
487 // Ex: skeleton as
489 if (skeleton.indexOf("unit-width-narrow") >= 0) {
492 // Ex: skeleton as
497 // Parse Notation from skeleton.
498 Notation NotationFromSkeleton(const icu::UnicodeString& skeleton) {
499 // Ex: skeleton as
501 if (skeleton.indexOf("scientific") >= 0) {
504 // Ex: skeleton as
506 if (skeleton.indexOf("engineering") >= 0) {
509 // Ex: skeleton as
512 if (skeleton.indexOf("compact-") >= 0) {
515 // Ex: skeleton as
534 // Return CompactString as string based on skeleton.
536 const icu::UnicodeString& skeleton) {
537 // Ex: skeleton as
539 if (skeleton.indexOf("compact-long") >= 0) {
542 // Ex: skeleton as
544 DCHECK_GE(skeleton.indexOf("compact-short"), 0);
548 // Return SignDisplay as string based on skeleton.
550 const icu::UnicodeString& skeleton) {
551 // Ex: skeleton as
553 if (skeleton.indexOf("sign-never") >= 0) {
556 // Ex: skeleton as
559 if (skeleton.indexOf("sign-always") >= 0 ||
560 skeleton.indexOf("sign-accounting-always") >= 0) {
563 // Ex: skeleton as
566 if (skeleton.indexOf("sign-accounting-except-zero") >= 0 ||
567 skeleton.indexOf("sign-except-zero") >= 0) {
570 // Ex: skeleton as
573 if (skeleton.indexOf("sign-accounting-negative") >= 0 ||
574 skeleton.indexOf("sign-negative") >= 0) {
580 // Return RoundingMode as string based on skeleton.
582 const icu::UnicodeString& skeleton) {
584 int32_t start = skeleton.indexOf(rounding_mode);
587 icu::UnicodeString check = skeleton.tempSubString(start + 14);
589 // Ex: skeleton as
594 // Ex: skeleton as
599 // Ex: skeleton as
604 // Ex: skeleton as
609 // Ex: skeleton as
614 // Ex: skeleton as
619 // Ex: skeleton as
624 // Ex: skeleton as
630 // Ex: skeleton as
636 const icu::UnicodeString& skeleton) {
637 int32_t cur = skeleton.indexOf(u"precision-increment/");
641 while (cur < skeleton.length()) {
642 char16_t c = skeleton[cur++];
650 // Return RoundingPriority as string based on skeleton.
652 const icu::UnicodeString& skeleton) {
655 if ((found = skeleton.indexOf("#r")) >= 0 ||
656 (found = skeleton.indexOf("@r")) >= 0) {
657 if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
662 if ((found = skeleton.indexOf("#s")) >= 0 ||
663 (found = skeleton.indexOf("@s")) >= 0) {
664 if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
671 // Return trailingZeroDisplay as string based on skeleton.
673 const icu::UnicodeString& skeleton) {
675 if ((found = skeleton.indexOf("/w")) >= 0) {
676 if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
686 // "integer-width/*" in the skeleton.
687 // Ex: Return 15 for skeleton as
693 const icu::UnicodeString& skeleton) {
696 int32_t index = skeleton.indexOf(search);
700 while (index < skeleton.length() && skeleton[index] == '0') {
709 // The minimum fraction digits is the number of '0' after '.' in the skeleton
712 // For example, as skeleton “.000#### rounding-mode-half-up”
717 const icu::UnicodeString& skeleton, int32_t* minimum, int32_t* maximum) {
719 int32_t index = skeleton.indexOf(search);
723 while (index < skeleton.length() && IsDecimalDigit(skeleton[index])) {
728 while (index < skeleton.length() && skeleton[index] == '#') {
736 // The minimum significant digits is the number of '@' in the skeleton
744 const icu::UnicodeString& skeleton, int32_t* minimum, int32_t* maximum) {
746 int32_t index = skeleton.indexOf(search);
750 while (index < skeleton.length() && skeleton[index] == '@') {
755 while (index < skeleton.length() && skeleton[index] == '#') {
770 std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
772 str = skeleton.toUTF8String<std::string>(str);
806 Style StyleFromSkeleton(const icu::UnicodeString& skeleton) {
807 if (skeleton.indexOf("currency/") >= 0) {
810 if (skeleton.indexOf("percent") >= 0) {
812 if (skeleton.indexOf("scale/100") >= 0) {
819 if (skeleton.indexOf("unit/") >= 0) {
922 icu::UnicodeString skeleton = icu_number_formatter->toSkeleton(status);
930 NumberingSystemFromSkeleton(skeleton);
968 Style style = StyleFromSkeleton(skeleton);
973 const icu::UnicodeString currency_ustr = CurrencyFromSkeleton(skeleton);
984 CurrencyDisplayString(isolate, skeleton), Just(kDontThrow))
988 CurrencySignString(isolate, skeleton), Just(kDontThrow))
993 std::string unit = UnitFromSkeleton(skeleton);
1003 UnitDisplayString(isolate, skeleton), Just(kDontThrow))
1010 factory->NewNumberFromInt(MinimumIntegerDigitsFromSkeleton(skeleton)),
1015 if (SignificantDigitsFromSkeleton(skeleton, &minimum, &maximum)) {
1025 FractionDigitsFromSkeleton(skeleton, &minimum, &maximum);
1039 UseGroupingFromSkeleton(isolate, skeleton), Just(kDontThrow))
1044 factory->ToBoolean(UseGroupingFromSkeleton(skeleton)),
1049 Notation notation = NotationFromSkeleton(skeleton);
1058 CompactDisplayString(isolate, skeleton), Just(kDontThrow))
1063 SignDisplayString(isolate, skeleton), Just(kDontThrow))
1068 RoundingModeString(isolate, skeleton), Just(kDontThrow))
1072 RoundingIncrement(isolate, skeleton), Just(kDontThrow))
1076 TrailingZeroDisplayString(isolate, skeleton), Just(kDontThrow))
1080 RoundingPriorityString(isolate, skeleton), Just(kDontThrow))