Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add support for number format expression #14842

Closed
tobrun opened this issue Jun 4, 2019 · 4 comments
Closed

Add support for number format expression #14842

tobrun opened this issue Jun 4, 2019 · 4 comments
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS

Comments

@tobrun
Copy link
Member

tobrun commented Jun 4, 2019

This issue tracks adding number-format expression to the android binding. Core PR is happening in #14840, original core issue in #13632 (which is a gl-js parity issue to mapbox/mapbox-gl-js#7626).

@tobrun tobrun added Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS labels Jun 4, 2019
@1ec5
Copy link
Contributor

1ec5 commented Jun 5, 2019

Besides adding number-format to the Android expression DSL, the actual formatting should be implemented in Java in platform/android/src/string_util.cpp and platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/StringUtils.java based on NumberFormat.format(double).

/ref #14840 (review)

@tobrun tobrun added this to the release-ristretto milestone Aug 20, 2019
@tobrun
Copy link
Member Author

tobrun commented Aug 20, 2019

Started to work on this, have a basic version working.The following expression will result in a symbol layer as shown in screenshot:

numberFormatSymbolLayer.setProperties(
  textField(
    numberFormat(123.456789, locale("nl"), currency("EUR"))
  )
);

image (9)

To be investigated why the € sign isn't showing properly though.

@tobrun
Copy link
Member Author

tobrun commented Aug 20, 2019

Capturing from @jmalanen that the correct locale for this configuration = nl-NL

    numberFormatSymbolLayer.setProperties(
      textField(
        numberFormat(123.456789, locale("nl-NL"), currency("EUR"))
      )
    );

image

@tobrun
Copy link
Member Author

tobrun commented Sep 6, 2019

landed in #15424

@tobrun tobrun closed this as completed Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

2 participants