Print results in another base, if another base than 10 is used

This commit is contained in:
PaddiM8 2024-03-31 17:34:50 +02:00
parent 7bce5409e6
commit 74d787fe5d
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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",