WPCubed Product Support

Formating float problem.

Hi, I have searched the forum, but didnt found the solution, so here goes my question:

I am using the FloatToCurr function to make a float number "nice".
but I dont want the currency at all - and I dont see a function for this.

Is there a function to use for formating a number into this format:

1.333.222.111,12

thanks.

  • Btw, I have tried this solution:

var
mysum : real;
begin
mysum := 123.45;
DBWPEvalEngine1.Variables.Add('mysum := ' + Format('%8.2n', [mysum]));
end;

BUT, when I use <<@mysum>> it only print integer numbers? - is this a bug? or is there something I havnt seen?

  • Btw - Btw - If you want a reseller in Denmark, I can do the job for you.

Get back to me, if this have any interrest.
Best regards
Dennis


easyvape vaporizer

#1 ✎ ♥ 0
6.5k Views 2 links 3 users read 2 min
support

Hi,

I don't have an answer here. The EvenEngine is limited to use standard float numbers - with one decimal point.

You will neeed to use the GetText event and format the number in your code. (You can use EvalEngine to "Evaluate()" the string after @ and format the result)

Julian

#2 ♥ 0

Hi Julian,

I have tried alot for formatting the output.

I am using this: @FloatToCurr(orders.amountl*orders.price)

The output is fine! - But the digits will alway be ,00

why cant it be ,50 or ,25 ?


vaporizer questions

#3 ✎ ♥ 0

Hope I'm not missing the point here, but if you are still looking for a function to format in code, you can use the Delphi FloatToStrF. The Format parameter gives you all the possible combinations you may need.

#4 ♥ 0
This category is archived. No new posts are possible.