Calculator
Calculator is the ryOS utility app for basic arithmetic, scientific functions, unit conversion, and live currency conversion.
Overview
Calculator follows the current desktop theme instead of using one fixed skin. Aqua themes use compact and full calculator chrome, System 7 gets a small classic panel, and Windows 98 / XP use their own styled panels.
The app supports three modes. Basic mode covers everyday arithmetic with percent and memory keys. Scientific mode adds trig, logarithms, powers, roots, factorial, constants, and a degree/radian toggle. Conversion mode handles units such as length, area, volume, mass, temperature, speed, time, pressure, energy, and currency.
Currency conversion fetches exchange rates through the shared ryOS currency API path. If rates cannot be loaded, the conversion panel shows the localized currency error message and keeps the rest of the calculator usable.
Features
- Basic arithmetic with memory store, recall, add, subtract, and clear
- Scientific functions for trig, logs, powers, roots, factorial, pi, and e
- Degree/radian angle mode
- Unit conversion across measurement categories
- Live currency conversion through the ryOS API
- Theme-specific calculator panels for Aqua, System 7, Windows 98, and Windows XP
- Keyboard input for digits and operators
- View menu switching between Basic, Scientific, and Conversion modes
User Guide
Getting Started
Open Calculator from the desktop, launcher, or Applications folder. Use the View menu to switch between Basic, Scientific, and Conversion modes.
Key Actions
- Calculate: Enter numbers and operators with the buttons or keyboard.
- Use memory: Store, recall, add to, subtract from, or clear the memory value.
- Switch angle mode: In Scientific mode, toggle between degrees and radians.
- Convert units: In Conversion mode, choose a category, source unit, destination unit, and amount.
- Swap units: Use the swap control in Conversion mode to reverse source and destination units.
Tips
- Conversion mode resizes the window to fit the unit controls.
- Currency conversion depends on network access and the configured ryOS API.
- The window chrome and key styling change with the active OS theme.
Technical Details
Component Architecture
src/apps/calculator/components/CalculatorAppComponent.tsx- App shell and menu/dialog wiring
src/apps/calculator/components/CalculatorBody.tsx- Theme and mode selection for calculator panelssrc/apps/calculator/components/CalculatorBasicPanel.tsx- Basic keypadsrc/apps/calculator/components/CalculatorScientificPanel.tsx- Scientific keypadsrc/apps/calculator/components/CalculatorConversionPanel.tsx- Unit and currency conversion UIsrc/apps/calculator/components/CalculatorMenuBar.tsx- View, Help, and About menus
State and Logic
src/apps/calculator/hooks/useCalculatorLogic.tsowns mode, display, memory, angle mode, conversion state, and translated help items.
src/apps/calculator/utils/calculatorEngine.tsimplements arithmetic, memory operations, scientific operators, and input handling.src/apps/calculator/utils/conversionData.tsdefines conversion categories, units, conversion formulas, and currency rate application.src/apps/calculator/utils/windowSizes.tsmaps mode and theme to window sizes.
Related Apps
- Dashboard - Includes a currency widget that shares the currency-rate data path
- Control Panels - Theme settings change Calculator's visual style