GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Device number format · Issue #10588 · NativeScript/NativeScript

Add Device number format #10588

New issue
Copy link
New issue
Copy link
Open
Open
Add Device number format#10588
Copy link
Labels
feature

Description

@jasongitmail
jasongitmail
opened on Jul 21, 2024
Issue body actions

Is your feature request related to a problem? Please describe.

I'd like to more easily & accurately identify the user's preferred number format, to use when formatting numbers in my app to match this.

Describe the solution you'd like

I'd like to see NativeScript's Device class contain a numberFormat property to expose their OS-level user preference:

Identifying the user's preference is the goal here; not actually reformatting of numbers. Once I have that, I can handle formatting numbers within my app to match their preference.

From iOS Settings -> General -> Language & Region -> Number Format:
Simulator Screenshot - iPhone 15 Pro - 2024-07-21 at 18 05 46

Describe alternatives you've considered

I've tried:

  • Using Intl.NumberFormatter in NativeScript (v8.7.2), but it is broken and always uses a comma thousands separator. The Intl class is not supported currently apparently.
  • I've considered npm's Intl class, but it hasn't been updated in 8 years, and I found errors, shockingly, even in the current NodeJS Intl class for thousands and fractional separators for certain regions. This class is also not consistent with iOS's number formatting for certain regions.
  • I ended up using a Node script to create base data set of thousands and fractional separators, and then manually correcting and handling scenarios such as french-speaking Canada vs English speaking Canada.

However, all of the above are error prone, require maintenance, and are not guaranteed to respect/match the user's system-level preference on iOS.

The ideal solution would be to get this from the user's iOS system preferences, so we can format it to what the user expects.

Anything else?

No response

Please accept these terms

  • I have searched the existing issues as well as StackOverflow and this has not been posted before
  • I agree to follow this project's Code of Conduct
Reacted by nove1398

Activity

  1. jasongitmail
    added
    feature-pending-triageA new feature request pending triage to confirm validity.A new feature request pending triage to confirm validity.
    on Jul 21, 2024
  2. CatchABus commented on Jul 21, 2024

    @CatchABus
    CatchABus
    on Jul 21, 2024
    Contributor
    More actions

    For the time being, you can make use of formatjs polyfills: https://formatjs.io/docs/polyfills

  3. jasongitmail commented on Jul 23, 2024

    @jasongitmail
    jasongitmail
    on Jul 23, 2024
    Author
    More actions

    Appreciate it; I created my own temporary solution.

    For clarity for the maintainers, this issue about getting the preferred number format from the user's device settings--i.e. just knowing what their preferred format is, not about implementing a function to format numbers to it.

  4. triniwiz commented on Jul 27, 2024

    @triniwiz
    triniwiz
    on Jul 27, 2024
    Member
    More actions

    @jasongitmail you can check out here or here for android and here for ios

  5. jasongitmail commented on Jul 27, 2024

    @jasongitmail
    jasongitmail
    on Jul 27, 2024
    Author
    More actions

    The feature request is about this being available within NativeScript's Device class.

    But those seem like useful links for someone implementing it

    Reacted by Osei Fortune
  6. NathanWalker
    added
    feature
    and removed
    feature-pending-triageA new feature request pending triage to confirm validity.A new feature request pending triage to confirm validity.
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.