1

Topic: Problem with function the WHOLE

There is a price 120,32 it is necessary to space apart separately roubles 120 / copecks 32 (if 0 copecks should be 00)
I do like the elementary things
Roubles WHOLE (120,32) = 120
Copecks IF ((C2-D2) *100=0; "00"; WHOLE ((C2-D2) *100)) = and here that 31
I.e. WHOLE ((120,31-120) *100) = 31
I.e. WHOLE ((120, 32 -120) *100) = 31 but WHOLE ((50, 32 -50) *100) = 32
I.e. WHOLE ((120, 33 -120) *100) = 32
I.e. WHOLE ((120,34-120) *100) = 34
Made =C1*100-D1*100 but why WHOLE so strange considers?

2

Re: Problem with function the WHOLE

Because a fractional part  in a binary type precisely, and visible you 120,32 actually any 120,31111111119.
Though it is strange... Most likely you 120,32 is the result of calculation displayed with 2 digits after a comma, and in practice it 120,31

3

Re: Problem with function the WHOLE

parametr
To bypass so it is possible.
Copecks = (C2*100; 2)

4

Re: Problem with function the WHOLE

Akina :
Because a fractional part  in a binary type precisely, and visible you 120,32 actually any 120,31111111119.
Though it is strange... Most likely you 120,32 is the result of calculation displayed with 2 digits after a comma, and in practice it 120,31

It not design values. I hands enter 120,32. Thus it turns out 120,31 = 120,31, and here 120,32 = 120,311111111... And 120,34 again = 120,34
And for example 50,32=50,32 here therefore and interesting, from what??
Adding from 10/5/2017 11:20:

AlexL :
parametr
To bypass so it is possible.
Copecks = (C2*100; 2)

To bypass yes, truth protection against the fool not always works, in particular 120,321 produces, 3
Plus at me the task stood actually formation of price lists through Mailing in the Word (a template a Word + data source an ex-fur-tree + + the price) and there important copecks in the double-valued type 00 to cling. I.e. 120,01 = 120 + 01
Interest to learn, why 120,31 it is 120,31, and 120,32 it 120,31111 there still
I by the way solved the problem through tonsils certainly, but these are Mailing singularities
=The TEXT (WHOLE (C3); "0") for roubles
=The TEXT ((C3*100-E3*100); "00") for copecks
And all the same in places clings copecks as (,) i.e. value from a comma (for example 74,) but here I already surrendered and at me this comma simply does not get to a press zone

5

Re: Problem with function the WHOLE

At last looked at your formula more attentively.
In general, so: in what-thread 2 push the formula = (C2-D2) *100 (it is argument of yours WHOLE () in the unit DIFFERENTLY) and install a format - numerical with 13 signs after a comma.

6

Re: Problem with function the WHOLE

Akina :
At last looked at your formula more attentively.
In general, so: in what-thread 2 push the formula = (C2-D2) *100 (it is argument of yours WHOLE () in the unit DIFFERENTLY) and install a format - numerical with 13 signs after a comma.

It I already saw. And WHY??
120,32-120=31,999999999999999300 (here 9 from , in general it is a lot of them)
50,32-50=32,00000000000000000000000000000000000 (and here without  only 0)

7

Re: Problem with function the WHOLE

And esteem about that, how decimal numbers with a floating point are represented in a binary format, and why they inexact.

8

Re: Problem with function the WHOLE

parametr
IF ((C2-D2) *100 =0
What for here multiply on 100?

9

Re: Problem with function the WHOLE

Bobbie
What for here multiply on 100?
That shares of copecks did not get to copecks.

10

Re: Problem with function the WHOLE

It is normally accepted to store the prices in a type of an integer number of copecks.
Then these problems with a rounding off (and others different) will not be.
Sometimes them store in text boxes...

11

Re: Problem with function the WHOLE

uvs
Then these problems with a rounding off (and others different) will not be.
Yes ... Not all goods - piece.
Sometimes them store in text boxes... and then grow wiser and alter.