Skip to content

splitbill: tip with a % sign crashes #48

Done

Description

@divya0795

Did you search first?

  • I searched this repository's issues for my bug

What went wrong?

A tip written with a percent sign, like 15%, crashes splitbill. The --help text and README say both 15 and 15% work.

Steps to reproduce

python bug-hunt/splitbill.py 100 --tip 15

What did you expect?

A tip of $15.00 and a total of $115.00. README.md says "15" and "15%" mean the same.

What happened instead?

Traceback (most recent call last):
  File "bug-hunt/splitbill.py", line 61, in <module>
    raise SystemExit(main())
                     ^^^^^^
  File "bug-hunt/splitbill.py", line 46, in main
    tip_percent = parse_percent(args.tip)
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "bug-hunt/splitbill.py", line 18, in parse_percent
    return float(text)
           ^^^^^^^^^^^
ValueError: could not convert string to float: '15%'

splitbill version

splitbill 1.2.0

Python version

Python 3.12.16

Operating system

macOS 26.3

Activity

  1. divya0795 commented on Nov 26, 2026

    @divya0795
    ContributorAuthor

    Closing: I opened this from the CLI, so the bug-hunt label wasn't applied and the bot skipped it. Re-filing through the Bug hunt form for #45.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions