Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a78490bf
Commit
a78490bf
authored
Feb 28, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Mar 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix fractional calculation.
parent
297e559a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
varformat.c
dlls/oleaut32/tests/varformat.c
+1
-1
varformat.c
dlls/oleaut32/varformat.c
+4
-5
No files found.
dlls/oleaut32/tests/varformat.c
View file @
a78490bf
...
@@ -390,7 +390,7 @@ static void test_VarFormat(void)
...
@@ -390,7 +390,7 @@ static void test_VarFormat(void)
VARFMT
(
VT_R8
,
V_R8
,
8
.
0995
,
"#.##"
,
S_OK
,
"8.1"
);
VARFMT
(
VT_R8
,
V_R8
,
8
.
0995
,
"#.##"
,
S_OK
,
"8.1"
);
VARFMT
(
VT_R8
,
V_R8
,
0
.
0994
,
"#.##"
,
S_OK
,
".1"
);
VARFMT
(
VT_R8
,
V_R8
,
0
.
0994
,
"#.##"
,
S_OK
,
".1"
);
VARFMT
(
VT_R8
,
V_R8
,
1
.
00
,
"#,##0.00"
,
S_OK
,
"1.00"
);
VARFMT
(
VT_R8
,
V_R8
,
1
.
00
,
"#,##0.00"
,
S_OK
,
"1.00"
);
todo_wine
VARFMT
(
VT_R8
,
V_R8
,
0
.
0995
,
"#.###"
,
S_OK
,
".1"
);
VARFMT
(
VT_R8
,
V_R8
,
0
.
0995
,
"#.###"
,
S_OK
,
".1"
);
/* 'out' is not cleared */
/* 'out' is not cleared */
...
...
dlls/oleaut32/varformat.c
View file @
a78490bf
...
@@ -1296,8 +1296,7 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
...
@@ -1296,8 +1296,7 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
/* Rounding the number */
/* Rounding the number */
if
(
have_frac
>
need_frac
)
if
(
have_frac
>
need_frac
)
{
{
prgbDig
=
&
rgbDig
[
have_int
+
need_frac
?
need_frac
+
1
:
0
];
prgbDig
=
&
rgbDig
[
have_int
+
need_frac
];
if
(
*
prgbDig
<
5
)
prgbDig
--
;
have_frac
=
need_frac
;
have_frac
=
need_frac
;
if
(
*
prgbDig
>=
5
)
if
(
*
prgbDig
>=
5
)
{
{
...
@@ -1320,10 +1319,10 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
...
@@ -1320,10 +1319,10 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
}
}
else
else
(
*
prgbDig
)
++
;
(
*
prgbDig
)
++
;
/* We converted trailing digits to zeroes => have_frac has changed */
while
(
have_frac
>
0
&&
rgbDig
[
have_int
+
have_frac
-
1
]
==
0
)
have_frac
--
;
}
}
/* We converted trailing digits to zeroes => have_frac has changed */
while
(
have_frac
>
0
&&
rgbDig
[
have_int
+
have_frac
-
1
]
==
0
)
have_frac
--
;
}
}
TRACE
(
"have_int=%d,need_int=%d,have_frac=%d,need_frac=%d,pad=%d,exp=%d
\n
"
,
TRACE
(
"have_int=%d,need_int=%d,have_frac=%d,need_frac=%d,pad=%d,exp=%d
\n
"
,
have_int
,
need_int
,
have_frac
,
need_frac
,
pad
,
exponent
);
have_int
,
need_int
,
have_frac
,
need_frac
,
pad
,
exponent
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment