cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Impactful Individual
Impactful Individual

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
Impactful Individual
Impactful Individual

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
Impactful Individual
Impactful Individual

@WarrenBelz I see, thank you very much!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,256)