Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Half up rounding not done for integer = '45141.58832' (actual: 45141, expected: 45142) #1431

Closed
sandraros opened this issue Apr 13, 2024 · 5 comments
Assignees

Comments

@sandraros
Copy link

There's a failure with abap2xlsx unit test (see the log corresponding to the pull request abap2xlsx/abap2xlsx#1197).

Probably, it's related to this code:

* 45141.58832 (2023/08/03 14:07:11) ip_exact = abap_false -> 2023/08/04
    TRY.
        ep_value = zcl_excel_common=>excel_string_to_date( ip_value = '45141.58832'
                                                           ip_exact = abap_false ).
        cl_abap_unit_assert=>assert_equals(
          act   = ep_value
          exp   = '20230804' ).

and zcl_excel_common=>excel_string_to_date:

  METHOD excel_string_to_date.
    DATA: lv_date_int TYPE i.
    DATA lv_error_text TYPE string.

    CHECK ip_value IS NOT INITIAL AND ip_value CN ' 0'.

    TRY.
        IF ip_exact = abap_false.
          lv_date_int = ip_value.
        ELSE.
          lv_date_int = trunc( ip_value ).

The code which should be executed is lv_date_int = ip_value, where ip_value = '45141.58832'. I guess that the transpiler calculates 45141, but it should calculate 45142.

Thank you.

@larshp
Copy link
Member

larshp commented Apr 14, 2024

thanks, note its not a required check in abap2xlsx, also feel free to ping me in the PR if it fails

looking into it now

@sandraros
Copy link
Author

Oh I didn't realize it was optional, no hurry so. Thank you.

@larshp
Copy link
Member

larshp commented Apr 14, 2024

reproduced,
image

@larshp
Copy link
Member

larshp commented Apr 14, 2024

@sandraros try again, 2.8.24 published

I've also opened abap2xlsx/abap2xlsx#1207

@larshp larshp assigned sandraros and unassigned larshp Apr 14, 2024
@sandraros
Copy link
Author

It's now okay, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants