Questions tagged [decimal]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
3answers
1k views

Why is Salesforce hiding Discount, UnitPrice and TotalPrice decimals?

I've been migrating some QuoteLineItem and OpportunityLineItem records, and I noticed an odd behavior of the Salesforce platform. First, here are the field definitions: Here, we can see that: ...
8
votes
4answers
26k views

How to convert a number into a formatted string?

Note: there is an extensive discussion on converting a string into a decimal. This question asks how to convert a number into a formatted string. Given a decimal variable, how can I convert that ...
1
vote
2answers
1k views

Displaying more than 2 decimals for currency field in Report

I have a one currency field in an object, and I have kept 5 decimal places to that currency field. while showing the same field in a report it is showing only 2 decimal places. How can I change the ...
8
votes
2answers
4k views

Which decimal symbol is used in the current user's Locale

For complicated reasons I need to find out which symbol (dot or comma) is used for Decimals in the current User's Locale. Is there any way to find that out using Apex or formulas?
1
vote
1answer
923 views

Validation for decimal field to restrict blank values and string values in visual force page

I have a visual force page in which I have a field to accept decimal values. I can restrict the user from entering 0.0 and null values, but I cant do the same for '' (Empty String). Is there any ...
7
votes
1answer
960 views

The Do's and Don'ts of currency calculations in Apex

Ok, I am not a math expert, but I know about the basics of rounding problematics in programming languages. In one of my apps, I do some quite complex (math-wise and infrastructure -wise) currency ...
5
votes
3answers
10k views

Decimals in Apex: setting scale without rounding

Is there a possible way to set the scale of a decimal in Apex wihtout applying any rounding? (FI, the method setScale of Decimal object apply by default a half even rounding) Example: the following ...
11
votes
1answer
2k views

Converting between .NET decimal and SFDC decimal

We have a .NET app that interfaces with SFDC via a web service. When we import the WSDL the resulting classes will use the .NET type double wherever SFDC entities use a double. The problem I see here ...
7
votes
1answer
7k views

decimal places and text() formula

When I use the text formula, salesforce doesn't respect my decimal place formatting. For example, Field A has 4 places to the right of the decimal. It shows up nicely on the page as 0.4000 If I'm ...
32
votes
2answers
49k views

Round a Decimal to two decimal places

How can I round an arbitrary Decimal to 2 decimal places (hundredths of a dollar)? My first thought was to use the Math Functions ROUND(number, numDigits): Decimal toRound = 3.14159265359; ...

1
2