web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Decimal place

(0) ShareShare
ReportReport
Posted on by 150

I have created a currency converter.

I have used the code:

If(
Value(InputNumber_1.Text) > 999999999999,
Text(Value(InputNumber_1.Text)/1000000000000,"[$-en-us]###.##T"),
Value(InputNumber_1.Text) > 99999999,
Text(Value(InputNumber_1.Text)/1000000000,"[$-en-us]###.##B"),
Value(InputNumber_1.Text) > 999999,
Text(Value(InputNumber_1.Text)/1000000,"[$-en-us]###.##M"),
Value(InputNumber_1.Text) > 999,
Text(Value(InputNumber_1.Text)/1000,"[$-en-us]###.##k"),
And(Value(InputNumber_1.Text) <= 999, Value(InputNumber_1.Text) > 0),
Text(Value(InputNumber_1.Text),"[$-en-us]###"),
Value(InputNumber_1.Text) = 0,
0
)

 

But the output it is giving is like this

 

Moira0509_0-1677128246598.png

I don't want this decimal point to shown if there is no zero .

How can I achieve this

 

Categories:
  • Sanshubh Profile Picture
    512 on at

    You can write like this:-

     


    If(
    Value(InputNumber_1.Text) > 999999999999,
    Text(Value(InputNumber_1.Text)/1000000000000,"[$-en-us]###.##") & "T",
    Value(InputNumber_1.Text) > 99999999,
    Text(Value(InputNumber_1.Text)/1000000000,"[$-en-us]###.##") & "B",
    Value(InputNumber_1.Text) > 999999,
    Text(Value(InputNumber_1.Text)/1000000,"[$-en-us]###.##") & "M",
    Value(InputNumber_1.Text) > 999,
    Text(Value(InputNumber_1.Text)/1000,"[$-en-us]###.##") & "k",
    And(Value(InputNumber_1.Text) <= 999, Value(InputNumber_1.Text) > 0),
    Text(Value(InputNumber_1.Text),"[$-en-us]###"),
    Value(InputNumber_1.Text) = 0,
    0
    )

     

    And if you want to add space then just add space Before text like this : ( " T" )

  • Moira0509 Profile Picture
    150 on at

    But still it is showing output like this 10.M but I want output like 10 M only.

  • Sanshubh Profile Picture
    512 on at

    Then write nested IF conditions OR Remove Decimal Value.

  • Verified answer
    SoPatt Profile Picture
    Microsoft Employee on at

    Interesting. I'd call this a bug in the Text function. Here's a way though:

     

    With({X:Value(InputNumber_1.Text)},
     With({LogX:Min(Int(Log(X,1000)),4)},
     Round(X/1000^LogX,2) & Mid("kMBT",LogX,1)
     )
    )

     

     

     

  • Sanshubh Profile Picture
    512 on at

    Here:- 

    If(
    Value(InputNumber_1.Text) > 999999999999,
    Text(Value(InputNumber_1.Text)/1000000000000,"[$-en-us]###.00") & "T",
    Value(InputNumber_1.Text) > 99999999,
    Text(Value(InputNumber_1.Text)/1000000000,"[$-en-us]###.00") & "B",
    Value(InputNumber_1.Text) > 999999,
    Text(Value(InputNumber_1.Text)/1000000,"[$-en-us]###.00") & "M",
    Value(InputNumber_1.Text) > 999,
    Text(Value(InputNumber_1.Text)/1000,"[$-en-us]###.00") & "k",
    And(Value(InputNumber_1.Text) <= 999, Value(InputNumber_1.Text) > 0),
    Text(Value(InputNumber_1.Text),"[$-en-us]###"),
    Value(InputNumber_1.Text) = 0,
    0
    )

  • SoPatt Profile Picture
    Microsoft Employee on at

    Try my solution. It does what you want.

    sopatte_0-1677151455405.pngsopatte_1-1677151502513.png

    sopatte_2-1677151576461.png

    sopatte_0-1677152335051.png

     

     

    sopatte_3-1677151901078.png

     

  • Moira0509 Profile Picture
    150 on at

    Yeah its working.Thanks

  • Sanshubh Profile Picture
    512 on at

    Wow Bro 👍

  • SoPatt Profile Picture
    Microsoft Employee on at

    Math is cool 😄

  • Sanshubh Profile Picture
    512 on at

    I'm commerce student...😶

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard