Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Join the Conversation > Ask the community > Decimal places in a Variable View modes: 
User avatar
KnowledgeKube Staff
KnowledgeKube Staff
Rikard - 22/12/2016 14:48:05
   
RE:Decimal places in a Variable

I'm glad to hear it! You're very welcome. :)


User avatar
Advanced member
Advanced member
scot.jones - 22/12/2016 14:04:36
   
RE:Decimal places in a Variable

Hi Rikard.

Yes that spot on, exatly what I was looking for.

Thanks for your help :) 


User avatar
KnowledgeKube Staff
KnowledgeKube Staff
Rikard - 22/12/2016 12:50:44
   
RE:Decimal places in a Variable

The expression I posted will in fact accept both whole numbers and numbers that already contain decimals. For example, you've got a value of "12.1", the expression will return "12.10". However, there is also a way to use FormatNumber to return a currency value. :)

To do so you need to specify the fourth argument called OutputCulture so that it returns the correct currency value. The following example will return a currency value in pounds:

FormatNumber(CalculationResult,"en-GB","{0:C}","en-GB");

For example, if CalculationResult holds a value of "200.5" this expression will return "£200.50", with the decimal points and the currency symbol for the specified culture, which in this case is Great Britain.

Does that help at all? :)


1 2 3
RSS Feed