Skip to content

Commit

Permalink
document fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeplessy committed Dec 12, 2016
1 parent 911d097 commit 8dac842
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Use `SN_NUMBER foo(str)` to declare a scientific number class,use `foo.SN_Produc
scientific notation digits string.

## Example
<pre>
```cpp
std::string NumStr = "1024.96";
SN_NUMBER MyNum1(NumStr), MyNum2("123456");
std::cout << "MyNum1:" << MyNum1 << std::endl;
std::cout << "MyNum2:" << MyNum2 <<"Number of digits: "<< MyNum2.NDIGIT() << std::endl;
SN_NUMBER MyNum3("12a3445");
</pre>
```
*The Outputs would be:*
<pre>
Expand All @@ -28,22 +28,40 @@ Error info: Some of the inputs is not digit.
# Functions
Functions declared are listed by:
+ **SN_NUMBER(std:: string SN_NUMSTR, NTYPE type)**
# Document
Class' inside functions declared are listed by:
```cpp
SN_NUMBER(std:: string SN_NUMSTR, NTYPE type)
```
Construct a SN_NUMBER class using string,differs the explaination type.

Construct a SN_NUMBER class using string,differs the explaination type using the SN_NUMBER::NTYPE_ vars;
The default type is SN_NUMBER::NTYPE_EXP,which looks like:
```js
1.345789E3
```

+ **DOTP()**
For example:
```cpp
SN_NUMBER("3145.92657");
SN_NUMBER(str,SN_NUMBER::NTYPE_TENS);
SN_NUMBER("3145.92657",SN_NUMBER::NTYPE_EXP);
```
Rturns an interger that shows the dot's position in the former number.
+ **NDIGIT()**
```cpp
DOTP()
```

Returns an interger that shows the length of number.
Rturns an interger that shows the dot's position in the former number
```cpp
NDIGIT()
```

+ **DIGIT()**
Returns an interger that shows the length of number.

```cpp
DIGIT()
```
Returns an interger that shows the digits of former number's interger part.
# Support
Get easy to create issues if you find a bug,pull requests are welcomed.
Expand Down

0 comments on commit 8dac842

Please sign in to comment.