Giter Site home page Giter Site logo

Comments (2)

robertbastian avatar robertbastian commented on September 15, 2024

This would keep the data split between the short&narrow and long formatters.

Splitting data doesn't require a different type. If the data for short, narrow, and long, has the same shape, it should use the same data struct, just with three different markers and three different constructors.

from icu4x.

sffc avatar sffc commented on September 15, 2024
  • @robertbastian Are the shapes of the data the same?
  • @sffc The shape is different from short/narrow currency, but is it the same as units?
  • @younies:
    • in currencies:
      • pattern-one: "{0} {1}" per locale
      • display-name-one: "us dollar"
    • in units:
      • meter-pattern-one: "{0} meter" per unit
  • @sffc You could merge them at datagen time? "dollars per mile"
  • @younies There are a lot of open questions. Will users give units like: usd-per-meter
  • @sffc OK, so the pattern should be in its own marker, or currency essentials. And the names should go into a marker called "long currency".
  • @robertbastian In isolation this makes sense, but I don't know if it makes sense in the context of icu_dimension.
  • @sffc Currency is being designed as a standalone formatter.
  • @robertbastian The APIs should be similar to each other.
  • @younies Units are different. You construct complex units, use the unit identifier parser, maybe perform conversion, etc. With currency, people just give the currency code and that's it.

Data markers:

  • CurrencyEssentialsV1
  • CurrencyLongEssentialsV1
  • CurrencyLongNamesV1

Formatters:

  • CurrencyFormatter
    • Bikeshed: ShortNarrowCurrencyFormatter?
  • LongCurrencyFormatter

LGTM: @sffc @younies

from icu4x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.