Skip to content

Commit

Permalink
Print results in another base, if another base than 10 is used
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Mar 31, 2024
1 parent 7bce540 commit 74d787f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub(crate) const DEFAULT_PRECISION: u32 = 1024;
pub fn eval(parser: &mut parser::Context, input: &str, precision: u32, base: u8, format: ScientificNotationFormat) {
match parser::eval(parser, input, precision) {
Ok(Some(mut result)) => {
if !result.set_radix(base) {
if base != 10 && !result.set_radix(base) {
print_err("Invalid base. Change it by typing eg. `base 10`.");

return;
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddim8/kalk-component",
"version": "2.1.0",
"version": "2.1.1",
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
"svelte": "src/main.ts",
"main": "public/build/bundle.js",
Expand Down

0 comments on commit 74d787f

Please sign in to comment.