Simulating large numbers to test formatting

I’m trying to change the formatting for larger numbers, so for instance 1,250 > 1.25k, or 140,000,000 > 140M.

I think I figured out how to do it (see screenshot), but can’t figure out how to test if it’s working short of adding 1000 entries to the database. If I just type a large number in a text box, :count doesn’t work so I still can’t test it.

Is there an easy way to quickly add / remove lots of dummy data like that?

If you’re building a startup, I wouldn’t worry about this until you have at least 1 place where you exceed the number, and then it becomes really easy to test.

But, if you insist on doing it now, the code you wrote won’t look right to users because you don’t round the number. So, 1,001 will become 1.001k when you probably want it to be 1k.

Thanks for the tip. It’s an internal tool for a larger company, and I’m going to achieve >1k records within a month of launching, so it’s definitely something I want to figure out now.

Good point about rounding, is this how I would accomplish this?

Or this?

Thanks for the help.

Both approaches should work.

As for the original question - I don’t know a way to fully simulate large amounts of data without actually adding large amounts of data. That said, you could test parts of it pretty easily. For example, replace the Search with the value of a custom state that’s set to a default value of, say, 1001 and then you can test the rounding logic on that.

Okay perfect, didn’t think of that. Thanks for the help.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.