cancel
Showing results for
Did you mean:
Helper IV

## Big number format

How to format a number for example "123456789" in 123 456 789 ? Same number with spaces ...

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Hi @ProtoSup,

If the number is always 9 characters long, then you could opt for the approach below:

``````//Text property of a label
Text(123456789, "### ### ###")``````

Should the length of the number be unknown, give the following a try:

``````Concat(
With(
{
wSplitArray: Split(
12345678,
""
)
},
ForAll(
Sequence(CountRows(wSplitArray)),
Index(
wSplitArray,
Value
).Value & If(
Mod(
Value,
3
) = 0,
" "
)
)
),
Value
)``````

Replace all hardcoded references of the number with a reference to the number value.

If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

Thanks!

6 REPLIES 6
Super User

Hi @ProtoSup,

If the number is always 9 characters long, then you could opt for the approach below:

``````//Text property of a label
Text(123456789, "### ### ###")``````

Should the length of the number be unknown, give the following a try:

``````Concat(
With(
{
wSplitArray: Split(
12345678,
""
)
},
ForAll(
Sequence(CountRows(wSplitArray)),
Index(
wSplitArray,
Value
).Value & If(
Mod(
Value,
3
) = 0,
" "
)
)
),
Value
)``````

Replace all hardcoded references of the number with a reference to the number value.

If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

Thanks!

Helper IV

Ok thank you, in reality my number is 7 characters long, could you adapt your formula ? thanks again

Super User

Hey @ProtoSup,

Given that the number is always 7 numbers long, we can adjust the easy formula:

``````//This will show 1 234 567
Text(1234567, "# ### ###")``````

If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

Thanks!

Helper IV

ok @LaurensM , I want to try your formula but I din't understand where I have to put this formula :

```Concat(
With(
{
wSplitArray: Split(
12345678,
""
)
},
ForAll(
Sequence(CountRows(wSplitArray)),
Index(
wSplitArray,
Value
).Value & If(
Mod(
Value,
3
) = 0,
" "
)
)
),
Value
)```

Super User

Hi @ProtoSup,

That formula will return a formatted number as a Text value. It should be written in e.g. the Text property of a Label.

I hope this helps!

Helper IV

Sorry, I did not see youy two formulas was 2 different way to resolv my problem... Thank you sir

Announcements

#### Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!