# math.strip-unit()

The `math.strip-unit()` function strips the unit from a given [`$number`](#usdnumber).

{% code lineNumbers="true" %}

```scss
// Sass.
@use 'sass:math';

// The `math.strip-unit()` function.
@function strip-unit($number) {
  @return if(
    type-of($number) == number,
    math.div($number, ($number * 0 + 1)),
    $number
  );
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/math/_math.strip-unit.function.scss>" %}

### Parameters

#### **`$number`**

A `number` to strip the unit from.

### Return

The return value is a `number` without unit.

## Examples

```scss
// Use.
@use '@angular-package/sass/math';

// Examples.
@debug math.strip-unit(10px); // 10
@debug math.strip-unit(null); // null
@debug math.strip-unit(false); // false

```
