Add: RecordUtil
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
function RecordUtil() {
|
||||
}
|
||||
|
||||
RecordUtil.getRecordValueWithUnit = function(record, appID) {
|
||||
var recordValue = RecordUtil.getRecordValueText(record, appID);
|
||||
var recordUnit = RecordUtil.getRecordUnit(appID);
|
||||
|
||||
return recordValue + recordUnit;
|
||||
}
|
||||
|
||||
RecordUtil.getRecordValueText = function(record, appID) {
|
||||
if(appID == 104)
|
||||
return record.toFixed(2);
|
||||
else
|
||||
NumberUtil.numberWithCommas(Math.floor(record));
|
||||
}
|
||||
|
||||
RecordUtil.getRecordUnit = function(appID) {
|
||||
if(appID == 104)
|
||||
return " 초";
|
||||
else if(appID < 100)
|
||||
return " 타";
|
||||
else
|
||||
return " 점";
|
||||
}
|
||||
@@ -63,9 +63,10 @@ ScreenBottomUI.prototype.printText = function(textObject, text, align) {
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printLeftTextWithAppHighestRecord = function(bestRecord) {
|
||||
var roundUpBestRecord = Math.round(bestRecord);
|
||||
var highScoreWithCommas = NumberUtil.numberWithCommas(roundUpBestRecord);
|
||||
this.printLeftText("최고 기록 : " + highScoreWithCommas);
|
||||
this.printLeftText(
|
||||
"최고 기록 : "
|
||||
+ RecordUtil.getRecordValueWithUnit(bestRecord, sessionStorageManager.getPlayingAppID())
|
||||
);
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.getFontStyle = function() {
|
||||
|
||||
Reference in New Issue
Block a user