Skip to content

[FEAT]: Add the number lodash into this package #16

Description

@ImBIOS

Clear and concise description of the problem

Currently, the Lorust library lacks support for utility functions dealing with numbers. This leaves a gap in functionality that could benefit various applications that require mathematical operations, rounding, or other number manipulations.

Suggested solution

  1. Create a new module called number under the src directory.
  2. Implement the most commonly used lodash number utility functions in this module, such as:
    • add
    • ceil
    • floor
    • max
    • min
    • round
    • subtract
  3. Include thorough unit tests to cover all edge cases for each function.
  4. Update the README to indicate that the number category is now supported.

Code Example:

// src/number/mod.rs
pub fn add(a: f64, b: f64) -> f64 {
    a + b
}

pub fn ceil(value: f64, precision: u32) -> f64 {
    // implementation here
}
// ... more functions

Alternative

An alternative approach would be to introduce these functions incrementally in smaller batches, prioritizing the most commonly used or requested ones first.

Additional context

Having a number category that mimics lodash's number utilities would provide a more complete utility experience in Rust, thereby possibly attracting more developers to adopt Lorust in their projects. This would align well with the library's goal of being the Rust version of Lodash.

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions