react-native-animated-numbers icon indicating copy to clipboard operation
react-native-animated-numbers copied to clipboard

Gap between certain digits like 1

Open Rahul-Vignesh opened this issue 2 years ago • 7 comments

image

As you can see in the above screenshot, there is a visible gap between 1 and 0 which is odd. How can I fix it?

Occurs in both IOS and android devices.

Rahul-Vignesh avatar Mar 15 '22 09:03 Rahul-Vignesh

Have same issue too.

vitaliyirtlach avatar Mar 22 '22 15:03 vitaliyirtlach

I'm sorry but i cannot spend any time on this project for the next few months So it would be helpful if you can find a solution. 😹

heyman333 avatar Mar 23 '22 10:03 heyman333

image

As you can see in the above screenshot, there is a visible gap between 1 and 0 which is odd. How can I fix it?

Occurs in both IOS and android devices.

This is because there is 0-9 in every digit place, just hidden. I believe a static width is defined for every digit place, so every number, fat or thin, fits inside that width. So probably that's why there is this gap. I had to remove this package just because of that. But If anyone can find a way where width are adjusted dynamically then it'd solve it for all of us

tsachit avatar May 09 '22 17:05 tsachit

Same problem here... hard to understand from the code how to fix it :(

nechmads avatar Jul 04 '22 12:07 nechmads

What you can do is specify fontVariant: ['tabular-nums'] in the fontStyle prop. For example:

 pointsCounter: {
    fontSize: 42,
    fontWeight: 'bold',
    fontVariant: ['tabular-nums'],
  },

It'll align the digits in a more consistent way.

mherda avatar Aug 29 '22 13:08 mherda

What you can do is specify fontVariant: ['tabular-nums'] in the fontStyle prop. For example:

 pointsCounter: {
    fontSize: 42,
    fontWeight: 'bold',
    fontVariant: ['tabular-nums'],
  },

It'll align the digits in a more consistent way.

Great response. Maybe this should be made the default?

Huguet57 avatar Jan 29 '24 00:01 Huguet57