Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/docs/src/content/docs/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "API Reference"

# Conversion

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const conversion = new Conversion();
Expand All @@ -19,7 +19,7 @@ const result = conversion.value(10).from("meter").to("foot");
- Default: 2
- Number of decimal places to round the conversion result to.

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const conversion = new Conversion({ decimals: 4 });
Expand All @@ -33,7 +33,7 @@ const result = conversion.value(10).from("meter").to("foot");
- Default: false
- If true, the conversion result will be a floating-point number.

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const conversion = new Conversion({ isFloat: true });
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/content/docs/conversions/length.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This category is useful for engineering, construction, design, or any domain whe

## Quick Example

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion();
Expand All @@ -32,7 +32,7 @@ console.log(convert.value(1).from("inch").to("centimeter"));

All conversions are approximate to the configured decimal precision.

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion({ includeUnit: false });
Expand Down Expand Up @@ -80,7 +80,7 @@ convert.value(50).from("meter").to("yard");

Conversions can be customized with global config values when creating a Conversion instance.

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion({
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/conversions/number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The **Number** category supports conversions between number bases such as binary

## Quick Example

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion();
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/conversions/time.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The **time** category provides conversions between milliseconds, seconds, minute

## Quick Example

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion();
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A lightweight TypeScript library for converting units.

### Quick Start

```ts twoslash
```ts
import { Conversion } from "@devhaven/unit-conversion";

const convert = new Conversion();
Expand Down
2 changes: 1 addition & 1 deletion packages/unit-conversion/jsr.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devhaven/unit-conversion",
"version": "0.1.0",
"version": "0.1.1",
"exports": "./src/index.ts",
"license": "Apache-2.0",
"publish": {
Expand Down
2 changes: 1 addition & 1 deletion packages/unit-conversion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devhaven/unit-conversion",
"version": "0.1.0",
"version": "0.1.1",
"description": "A type-safe unit conversion library.",
"license": "Apache-2.0",
"author": "Ram Shankar Choudhary",
Expand Down