Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
d63a39f5
M
miniob
项目概览
oceanbase
/
miniob
1 年多 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
未验证
提交
d63a39f5
编写于
10月 13, 2022
作者:
羽飞
提交者:
GitHub
10月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add fload print function (#88)
上级
89d57d85
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
1 deletion
+54
-1
src/observer/sql/expr/tuple_cell.cpp
src/observer/sql/expr/tuple_cell.cpp
+3
-1
src/observer/util/util.cpp
src/observer/util/util.cpp
+32
-0
src/observer/util/util.h
src/observer/util/util.h
+19
-0
未找到文件。
src/observer/sql/expr/tuple_cell.cpp
浏览文件 @
d63a39f5
...
...
@@ -16,6 +16,7 @@ See the Mulan PSL v2 for more details. */
#include "storage/common/field.h"
#include "common/log/log.h"
#include "util/comparator.h"
#include "util/util.h"
void
TupleCell
::
to_string
(
std
::
ostream
&
os
)
const
{
...
...
@@ -24,7 +25,8 @@ void TupleCell::to_string(std::ostream &os) const
os
<<
*
(
int
*
)
data_
;
}
break
;
case
FLOATS
:
{
os
<<
*
(
float
*
)
data_
;
float
v
=
*
(
float
*
)
data_
;
os
<<
double2string
(
v
);
}
break
;
case
CHARS
:
{
for
(
int
i
=
0
;
i
<
length_
;
i
++
)
{
...
...
src/observer/util/util.cpp
0 → 100644
浏览文件 @
d63a39f5
/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved.
miniob is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
//
// Created by wangyunlai on 2022/9/28
//
#include <string.h>
#include "util/util.h"
std
::
string
double2string
(
double
v
)
{
char
buf
[
256
];
snprintf
(
buf
,
sizeof
(
buf
),
"%.2f"
,
v
);
size_t
len
=
strlen
(
buf
);
while
(
buf
[
len
-
1
]
==
'0'
)
{
len
--
;
}
if
(
buf
[
len
-
1
]
==
'.'
)
{
len
--
;
}
return
std
::
string
(
buf
,
len
);
}
src/observer/util/util.h
0 → 100644
浏览文件 @
d63a39f5
/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved.
miniob is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
//
// Created by wangyunlai on 2022/9/28
//
#pragma once
#include <string>
std
::
string
double2string
(
double
v
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录