メインコンテンツまでスキップ
バージョン: v2.0

convertFrom()

この関数は、レベルから XP を、またはその逆方向の変換を計算するために使用します。

パラメーター

ParameterTypeRequiredDefaultDescription
valuenumber変換する値。
type"level" or "xp"level変換元の種類。

戻り値

例外

  • XpFatal - value が数値ではない場合、または type が無効な場合。

const {convertFrom} = require('simply-xp');

const value = 10;
const type = "level";

const result = convertFrom(value, type)
console.log(result) // Returns Result