Closed ZackaryH8 closed 1 year ago
Sometimes I don't want a really precise vector and end up using toFixed on each value
Provide a .toFixed method on Vector2 and Vector3 classes so x, y, z can be truncated
.toFixed
declare module 'alt-shared' { export interface Vector3 { toFixed(decimals: number): Vector3; } }
import * as alt from 'alt-shared'; alt.Vector3.prototype.toFixed = function (decimals: number = 3): alt.Vector3 { return new alt.Vector3(this.x.toFixed(decimals), this.y.toFixed(decimals), this.z.toFixed(decimals)); };
No response
shared
If you have already written the code for it, why don't you just add it yourself and make a PR?
Just a reminder for me to add it
Description of the problem
Sometimes I don't want a really precise vector and end up using toFixed on each value
Desired solution for the problem
Provide a
.toFixed
method on Vector2 and Vector3 classes so x, y, z can be truncatedAlternatives you considered
Additional context
No response
Version
No response
Scope
shared