Skip to content

How to insert a comma with render? #62

Description

@socketopp

Hi, awesome lib!

How would I use render to insert a comma?
Also, using render, removes the className from the FlapDisplay object. I guess, it each render, I need to add className again?

<FlapDisplay chars={Presets.NUM} length={7} value={currentPrice.toString().replace('.', '')} className="L"
render={(data) => {
const { children } = data;
  return (<div className="L"> {children}</div>); 
}}

I have figured out this much.

The price look like this "1.01788"
I thought I would replace the dot so it looks like "101788" and then after the first element in the children list add a dot. However, I am not sure this is the "correct way" and right way to go.
I can't modify props because TypeError: "value" is read-only
What do you say?

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions