cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Post Prodigy
Post Prodigy

EDIT A NUMBER FIELD TO 0.000,00 EDIT A NUMBER FIELD TO 0.000,00 EDIT A NUMBER FIELD TO 0.000,00 EDIT A FIELD NUMBER FOR 0000.00 EDIT A FIELD NUMBER FOR 0000.00

The user enters values and the formatting appears as he types...

 

IF USER TYPE 12345

 

It shows: 123.45

 

if he types:

 

123456

 

The field shows: 1,234.56

 

And so on...

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

@Gorilla_8 ,

This works as below

NumberFormatDollers.gif

The OnChange of the Text Box is

UpdateContext(
   {
      varFormat: Text(
         Value(Self.Text) / 100,
         "[$-en]###,##0.00"
      )
   }
);
Reset(Self);
UpdateContext(
   {
      varFormat: Text(
         Value(Self.Text),
         "[$-en]###,##0.00"
      )
   }
)

The second bit avoid a "double division" if clicked twice

The Default of the Text Box would depend if you have it in a form requiring updating

If(
    Value(varFormat) > 0,
    varFormat,
    Blank()
)

where you would do this

If(
    Value(varFormat) > 0,
    varFormat,
    Text(Parent.Default,"[$-en]###,##0.00")
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

@Gorilla_8 ,

This works as below

NumberFormatDollers.gif

The OnChange of the Text Box is

UpdateContext(
   {
      varFormat: Text(
         Value(Self.Text) / 100,
         "[$-en]###,##0.00"
      )
   }
);
Reset(Self);
UpdateContext(
   {
      varFormat: Text(
         Value(Self.Text),
         "[$-en]###,##0.00"
      )
   }
)

The second bit avoid a "double division" if clicked twice

The Default of the Text Box would depend if you have it in a form requiring updating

If(
    Value(varFormat) > 0,
    varFormat,
    Blank()
)

where you would do this

If(
    Value(varFormat) > 0,
    varFormat,
    Text(Parent.Default,"[$-en]###,##0.00")
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Gorilla_8
Post Prodigy
Post Prodigy

Hi @WarrenBelz 

I put this on default of the card or the field:


If(
Value(varFormat) > 0,
varFormat,
Blank()
)

 

or this one:

 

If(
Value(varFormat) > 0,
varFormat,
Text(Parent.Default,"[$-en]###,##0.00")
)


Just understanding better...

@Gorilla_8 ,

It depends whether the card is in a form and you want the value to update and show current content (you did not mention this).

If in a form, you need the Parent.Default to display the current value if you open it on an existing record, otherwise you can simply put Blank().

Gorilla_8
Post Prodigy
Post Prodigy

@WarrenBelz I see, thank you very much!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,019)