Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useTrunc.md
1---2category: '@Math'3---45# useTrunc67Reactive `Math.trunc`.89## Usage1011```ts12import { useTrunc } from '@vueuse/math'1314const value1 = ref(0.95)15const value2 = ref(-2.34)16const result1 = useTrunc(value1) // 017const result2 = useTrunc(value2) // -218```1920## Type Declarations2122```ts23/**24* Reactive `Math.trunc`.25*26* @see https://vueuse.org/useTrunc27*28* @__NO_SIDE_EFFECTS__29*/30export declare function useTrunc(31value: MaybeRefOrGetter<number>,32): ComputedRef<number>33```34